aboutsummaryrefslogtreecommitdiff
path: root/compiler/parser/lexer.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--compiler/parser/lexer.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/parser/lexer.go b/compiler/parser/lexer.go
index d2237a5..01cebeb 100644
--- a/compiler/parser/lexer.go
+++ b/compiler/parser/lexer.go
@@ -176,18 +176,19 @@ func (l *lexer) next() (*token, error) {
if err != nil {
return nil, err
}
- switch tok.kind {
- case tokenKindBExpClose:
- l.modeStack.pop()
- case tokenKindCharRange:
- l.rangeState = rangeStateExpectRangeTerminator
- case tokenKindChar:
+ if tok.kind == tokenKindChar || tok.kind == tokenKindCodePointLeader || tok.kind == tokenKindCharPropLeader {
switch l.rangeState {
case rangeStateReady:
l.rangeState = rangeStateReadRangeInitiator
case rangeStateExpectRangeTerminator:
l.rangeState = rangeStateReady
}
+ }
+ switch tok.kind {
+ case tokenKindBExpClose:
+ l.modeStack.pop()
+ case tokenKindCharRange:
+ l.rangeState = rangeStateExpectRangeTerminator
case tokenKindCodePointLeader:
l.modeStack.push(lexerModeCPExp)
case tokenKindCharPropLeader: