Skip to content

Commit

Permalink
Fix backslash escapes not being properly handled
Browse files Browse the repository at this point in the history
Closes #134
  • Loading branch information
mavolin committed Oct 16, 2023
1 parent 4d3d932 commit dc7b24e
Show file tree
Hide file tree
Showing 5 changed files with 1,447 additions and 47 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ $(TEST_DIR)/issue_80/issue_80.go: $(TEST_DIR)/issue_80/issue_80.peg $(BINDIR)/pi
$(TEST_DIR)/issue_115/issue_115.go: $(TEST_DIR)/issue_115/issue_115.peg $(BINDIR)/pigeon
$(BINDIR)/pigeon -nolint $< > $@

$(TEST_DIR)/issue_134/issue_134.go: $(TEST_DIR)/issue_134/issue_134.peg $(BINDIR)/pigeon
$(BINDIR)/pigeon -nolint $< > $@

$(TEST_DIR)/left_recursion/left_recursion.go: \
$(TEST_DIR)/left_recursion/standart/leftrecursion/left_recursion.go \
$(TEST_DIR)/left_recursion/optimized/leftrecursion/left_recursion.go \
Expand Down
4 changes: 2 additions & 2 deletions grammar/pigeon.peg
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ CodeBlock ← '{' Code '}' {

Code ← ( ( Comment / CodeStringLiteral / ![{}] SourceChar )+ / '{' Code '}' )*

CodeStringLiteral ← '"' (`\"` / [^"\r\n])* '"' /
CodeStringLiteral ← '"' (`\"` / `\\` / [^"\r\n])* '"' /
'`' [^`]* '`' /
'\'' (`\'` / [^']+) '\''
'\'' (`\'` / `\\` / [^']+) '\''

__ ← ( Whitespace / EOL / Comment )*
_ ← ( Whitespace / MultiLineCommentNoLineTerminator )*
Expand Down
102 changes: 57 additions & 45 deletions pigeon.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc7b24e

Please sign in to comment.