aboutsummaryrefslogtreecommitdiff
path: root/lex.go
diff options
context:
space:
mode:
Diffstat (limited to 'lex.go')
-rw-r--r--lex.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/lex.go b/lex.go
index 7450888..f0631da 100644
--- a/lex.go
+++ b/lex.go
@@ -111,6 +111,18 @@ func readToken(br *bufio.Reader, line *int) (token, error) {
br.UnreadRune()
return token{kind: slash, line: *line}, nil
}
+ case '%':
+ next, _, err := br.ReadRune()
+ if err != nil {
+ return token{}, err
+ }
+
+ if next == '=' {
+ return token{kind: percentageEquals, line: *line}, nil
+ } else {
+ br.UnreadRune()
+ return token{kind: percentage, line: *line}, nil
+ }
case '(':
return token{kind: lparen, line: *line}, nil
case ')':