yhirose / go-peg

Yet another PEG (Parsing Expression Grammars) parser generator for Go
MIT License
63 stars 8 forks source link

unicode is not supported? #13

Closed luojc0517 closed 2 years ago

luojc0517 commented 2 years ago
var SYNTAX = `
MARKER          <-   ['>'|'<'|'='|'&'|'|'|'!'|'"'|'('|')'|'!' | '$' | '#' ]
IDENTIFIER      <-   < [a-z|A-Z]+ ('-' / '_' / [a-zA-Z0-9])* / (!MARKER [\u4e00-\u9fff|a-z|A-Z])(!MARKER [\u4e00-\u9fff|a-z|A-Z|0-9|'/'|'_'|'-'|'.'])* >
`

init with SYNTAX will return an error 3:22 syntax error

yhirose commented 2 years ago

No, it doesn't. https://github.com/yhirose/go-peg/blob/de25d6753cf19a2efc86e8be820de367b9fd5e20/parser.go#L80-L85

As mentioned in readme, go-peg is no longer maintained. Please consider to use cpp-peglib which supports more features like Unicode literal (\u????) and is tested fully.