<- 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.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/main/lex.go b/main/lex.go
index 6977f8a..fdb3b59 100644
--- a/main/lex.go
+++ b/main/lex.go
@@ -115,6 +115,8 @@ const (
TokenAt // @
TokenDot // .
TokenAst // *
+ TokenBar // |
+ TokenQuestion // ?
TokenPatternStringIndex // A string index in a pattern
TokenPatternIntegerIndex // An integer index in a pattern
)
@@ -185,6 +187,18 @@ func lexCommand(l *lexer) stateFunc {
case '*':
l.emit(TokenAst)
return lexCommand
+ case '|':
+ l.emit(TokenBar)
+ return lexCommand
+ case '(':
+ l.emit(TokenLParen)
+ return lexCommand
+ case ')':
+ l.emit(TokenRParen)
+ return lexCommand
+ case '?':
+ l.emit(TokenQuestion)
+ return lexCommand
case '{':
l.emit(TokenLBrace)
return lexCommand