Skip to content

Commit

Permalink
Fix lexing for extended expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
RZhang05 committed Sep 20, 2024
1 parent 3be11cf commit e9dc0ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions runtime/parser/lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (l *lexer) clear() {
l.cursor = 0
l.tokens = l.tokens[:0]
l.tokenCount = 0
l.mode = NORMAL
}

func (l *lexer) Reclaim() {
Expand Down
2 changes: 1 addition & 1 deletion runtime/parser/lexer/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func rootState(l *lexer) stateFn {
l.emitType(TokenBraceOpen)
if l.mode == STR_IDENTIFIER {
l.mode = STR_EXPRESSION
} else {
} else if l.mode == STR_EXPRESSION {
return l.error(fmt.Errorf("string template cannot contain {"))
}
case '}':
Expand Down

0 comments on commit e9dc0ed

Please sign in to comment.