Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backslash-escaping in the lens language is incorrect #495

Closed
lutter opened this issue Sep 16, 2017 · 0 comments
Closed

Backslash-escaping in the lens language is incorrect #495

lutter opened this issue Sep 16, 2017 · 0 comments

Comments

@lutter
Copy link
Member

lutter commented Sep 16, 2017

The backslash escaping in strings and regular expressions was handled incorrectly. In this module

module T =

  let s = "\\"
  let r = /\\\\/

  let slash = "/"

the lexer does not properly recognize the end of s or r since it views the ending characters as escaped, i.e. as \" and \/.

lutter added a commit to lutter/augeas that referenced this issue Sep 16, 2017
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 hercules-team#495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant