-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* src/lexer.l: properly handle backslash escaping in strings and regex
We used to look at a string literal like "\\" as not ending, and instead mistook \" as escaping the ending quotes. This (longstanding, embarrassing) bug would lead to weird syntax errors in lenses when encountered. Fixes #495
- Loading branch information
Showing
5 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Pass_Lexer = | ||
|
||
(* Some tests for corner cases for the lexer; they will all lead to | ||
* syntax errors if we are not lexing correctly *) | ||
|
||
let s1 = "\\" | ||
let s2 = "\ | ||
" | ||
|
||
let r1 = /\\\\/ | ||
|
||
let slash = "/" (* Just here to cause trouble if the lexer does not | ||
* properly terminate the above expressions *) |