Skip to content

Commit

Permalink
Merge pull request #135 from mavolin/fix/134
Browse files Browse the repository at this point in the history
Fix Backslash Escapes Not Being Properly Handled
  • Loading branch information
breml authored Oct 16, 2023
2 parents 783e261 + dc7b24e commit 456d46d
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 456d46d

Please sign in to comment.