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

Parser fails on strings with octal escape sequences #70

Open
miszczu opened this issue Sep 5, 2014 · 0 comments
Open

Parser fails on strings with octal escape sequences #70

miszczu opened this issue Sep 5, 2014 · 0 comments

Comments

@miszczu
Copy link

miszczu commented Sep 5, 2014

Parser fails on following string (notice double backslash): "var x = '\071[90m%s';"

parser = Parser()
parser.parse("var x = '\071[90m%s';")
Illegal character "'" at 1:8 after LexToken(EQ,'=',1,6)
Illegal character '' at 1:9 after LexToken(EQ,'=',1,6)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Karol\venv\lib\site-packages\slimit\parser.py", line 93, in parse
return self.parser.parse(text, lexer=self.lexer, debug=debug)
File "C:\Users\Karol\venv\lib\site-packages\ply\yacc.py", line 265, in parse
return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
File "C:\Users\Karol\venv\lib\site-packages\ply\yacc.py", line 1047, in parse
opt_notracktok = self.errorfunc(errtoken)
File "C:\Users\Karol\venv\lib\site-packages\slimit\parser.py", line 116, in p_error
self._raise_syntax_error(token)
File "C:\Users\Karol\venv\lib\site-packages\slimit\parser.py", line 89, in _raise_syntax_error
self.lexer.prev_token, self.lexer.token())
SyntaxError: Unexpected token (ID, 'm') at 1:16 between LexToken(NUMBER,'90',1,14) and LexToken(MOD,'%',1,17)

metatoaster added a commit to calmjs/calmjs.parse that referenced this issue Jun 8, 2017
- Also note that the following issues were addressed, where applicable
  to the lexer or parser.

  - rspivak/slimit#52
  - rspivak/slimit#54
  - rspivak/slimit#57
  - rspivak/slimit#59
  - rspivak/slimit#62
  - rspivak/slimit#65
  - rspivak/slimit#70
  - rspivak/slimit#73
  - rspivak/slimit#79
  - rspivak/slimit#81
  - rspivak/slimit#82
  - rspivak/slimit#90

- Will get the release out when I get some sleep.
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