Skip to content

Commit 4035c6c

Browse files
committed
Order tokens
1 parent 096a321 commit 4035c6c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (p *parser) parseFactor() *Factor {
8989

9090
func (p *parser) parseTerm() *Term {
9191
fs := []*Factor{p.parseFactor()}
92-
for tokenEnd < p.token && p.token < tokenPipe {
92+
for tokenEnd < p.token && p.token < tokenEqual {
9393
fs = append(fs, p.parseFactor())
9494
}
9595
return &Term{Factors: fs}

tokens.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ const (
88
tokenInvalid token = iota
99
tokenEnd
1010
tokenIdentifier
11-
tokenLiteral
12-
tokenLeftParen
13-
tokenLeftBracket
1411
tokenLeftBrace
15-
tokenPipe
12+
tokenLeftBracket
13+
tokenLeftParen
14+
tokenLiteral
1615
tokenEqual
17-
tokenRightParen
18-
tokenRightBracket
19-
tokenRightBrace
2016
tokenPeriod
17+
tokenPipe
18+
tokenRightBrace
19+
tokenRightBracket
20+
tokenRightParen
2121
)
2222

2323
func tokenString(t token, text string) string {

0 commit comments

Comments
 (0)