diff options
-rw-r--r-- | compiler/parser.go | 3 | ||||
-rw-r--r-- | compiler/parser_test.go | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/compiler/parser.go b/compiler/parser.go index 7b50459..5b8c912 100644 --- a/compiler/parser.go +++ b/compiler/parser.go @@ -329,6 +329,9 @@ func (p *parser) parseBExpElem() astNode { if p.consume(tokenKindCodePointLeader) { return p.parseCodePoint() } + if p.consume(tokenKindCharPropLeader) { + return p.parseCharProp() + } left := p.parseNormalChar() if left == nil { return nil diff --git a/compiler/parser_test.go b/compiler/parser_test.go index 79f89ff..aca08ec 100644 --- a/compiler/parser_test.go +++ b/compiler/parser_test.go @@ -488,6 +488,17 @@ func TestParser_parse(t *testing.T) { ), }, { + pattern: "[\\u{004E}]", + ast: newConcatNode( + newSymbolNodeWithPos(byte('N'), symPos(1)), + newEndMarkerNodeWithPos(1, endPos(2)), + ), + }, + { + pattern: "[\\p{Lu}]", + skipTestAST: true, + }, + { pattern: "a[]", syntaxError: synErrBExpNoElem, }, |