Skip to content

Commit c918152

Browse files
committed
go/grammar_parser: escape dash so we can parse dashes within classes
This fixes the parsing of the following expression: Foo <- [+\-] Which is equivalent to Foo <- '+' / '-'
1 parent 65b97ef commit c918152

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

go/grammar_parser.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ func (p *GrammarParser) parseEscapedChar() (string, error) {
481481
In rune
482482
Out string
483483
}{
484+
{In: '-', Out: "-"},
484485
{In: 'n', Out: "\\n"},
485486
{In: 'r', Out: "\\r"},
486487
{In: 't', Out: "\\t"},

0 commit comments

Comments
 (0)