Adds basic support for the Swift programming language

Text only lexer for now until Pygments catches up
This commit is contained in:
Andy Lindeman
2014-06-02 15:51:44 -04:00
parent 4cd35c1f33
commit 8f251e6756
45 changed files with 636 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
enum Rank: Int {
case Ace = 1
case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten
case Jack, Queen, King
func simpleDescription() -> String {
switch self {
case .Ace:
return "ace"
case .Jack:
return "jack"
case .Queen:
return "queen"
case .King:
return "king"
default:
return String(self.toRaw())
}
}
}
let ace = Rank.Ace
let aceRawValue = ace.toRaw()