diff --git a/runtime/parser/lexer/lexer.go b/runtime/parser/lexer/lexer.go index 5e9caf2f79..e5e224f850 100644 --- a/runtime/parser/lexer/lexer.go +++ b/runtime/parser/lexer/lexer.go @@ -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() { diff --git a/runtime/parser/lexer/state.go b/runtime/parser/lexer/state.go index a5e395a276..315ff25b07 100644 --- a/runtime/parser/lexer/state.go +++ b/runtime/parser/lexer/state.go @@ -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 '}':