Skip to content

Commit 975827a

Browse files
committedOct 25, 2020
Fix a crash bug
1 parent 0774ee6 commit 975827a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

Diff for: ‎tokenizer.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313
reservedToken tokenKind = "reserved"
1414
numberToken tokenKind = "number"
1515
identToken tokenKind = "ident"
16+
eosToken tokenKind = "eos"
1617
)
1718

1819
type token struct {
@@ -113,5 +114,6 @@ func tokenize(input string) ([]token, error) {
113114

114115
return nil, &invalidTokenError{input: input, position: i}
115116
}
117+
tokens = append(tokens, token{kind: eosToken})
116118
return tokens, nil
117119
}

0 commit comments

Comments
 (0)
Please sign in to comment.