<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/main/lex.go
diff options
context:
space:
mode:
Diffstat (limited to 'main/lex.go')
-rw-r--r--main/lex.go31
1 files changed, 1 insertions, 30 deletions
diff --git a/main/lex.go b/main/lex.go
index e93e42a..2826b1e 100644
--- a/main/lex.go
+++ b/main/lex.go
@@ -113,39 +113,10 @@ type TokenType int
const (
TokenErr TokenType = iota // Lexing error
TokenEOF // end of file
- TokenLParen // (
- TokenRParen // )
TokenLBrace // {
TokenRBrace // }
- TokenLBrack // [
- TokenRBrack // ]
TokenCommand // A command character
- TokenHash // #
- TokenAt // @
- TokenDot // .
- TokenAst // *
- TokenBar // |
- TokenOr // ||
- TokenAnd // &&
- TokenHat // ^
- TokenDollar // $
- TokenQuestion // ?
- TokenHatDollar // ^$
- TokenExclamation // !
- TokenTilde // ~
- TokenDoubleQuote // "
- TokenStringLiteral // A string literal, not including the " either side
- TokenNullLiteral // null
- TokenTrueLiteral // true
- TokenFalseLiteral // false
- TokenColon // :
- TokenComma // ,
TokenSubstituteDelimiter // usually / but could be something else
- TokenSubstitutePlaceholder // \1, \2 etc.
- TokenTerminalLiteral // One of {, }, [, ]
- TokenNumberLiteral // A number literal
- TokenPatternStringIndex // A string index in a pattern
- TokenPatternIntegerIndex // An integer index in a pattern
TokenSubex // A subex
)
@@ -208,7 +179,7 @@ func lexCommand(l *lexer) stateFunc {
case '}':
l.emit(TokenRBrace)
return lexCommand
- case 's':
+ case 's', 'S':
l.emit(TokenCommand)
return lexSubstitution
}