mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Adds basic support for the Swift programming language
Text only lexer for now until Pygments catches up
This commit is contained in:
17
samples/Swift/section-69.swift
Normal file
17
samples/Swift/section-69.swift
Normal file
@@ -0,0 +1,17 @@
|
||||
enum Suit {
|
||||
case Spades, Hearts, Diamonds, Clubs
|
||||
func simpleDescription() -> String {
|
||||
switch self {
|
||||
case .Spades:
|
||||
return "spades"
|
||||
case .Hearts:
|
||||
return "hearts"
|
||||
case .Diamonds:
|
||||
return "diamonds"
|
||||
case .Clubs:
|
||||
return "clubs"
|
||||
}
|
||||
}
|
||||
}
|
||||
let hearts = Suit.Hearts
|
||||
let heartsDescription = hearts.simpleDescription()
|
||||
Reference in New Issue
Block a user