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

Special attributes do not correctly handle ">" within strings #27

Open
d0c-s4vage opened this issue Oct 21, 2019 · 0 comments · May be fixed by #30
Open

Special attributes do not correctly handle ">" within strings #27

d0c-s4vage opened this issue Oct 21, 2019 · 0 comments · May be fixed by #30

Comments

@d0c-s4vage
Copy link
Owner

For example, from https://www.sweetscape.com/010editor/repository/files/EXE.bt:

WORD IMAGE_FILE_LARGE_ADDRESS_AWARE:1 <comment="0x0020  App can handle >2gb addresses">;

The > sign inside of the string causes a parsing error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/james/__ws__/dev/pfp/pfp/__init__.py", line 91, in parse
    printf=printf,
  File "/home/james/__ws__/dev/pfp/pfp/interp.py", line 733, in parse
    self._ast = self._parse_string(template, predefines)
  File "/home/james/__ws__/dev/pfp/pfp/interp.py", line 878, in _parse_string
    keep_scopes=predefines,
  File "/home/james/__ws__/dev/pfp/venv3/lib/python3.6/site-packages/py010parser/__init__.py", line 137, in parse_string
    keep_scopes     = keep_scopes
  File "/home/james/__ws__/dev/pfp/venv3/lib/python3.6/site-packages/py010parser/c_parser.py", line 178, in parse
    debug=debuglevel)
  File "/home/james/__ws__/dev/pfp/venv3/lib/python3.6/site-packages/py010parser/ply/yacc.py", line 265, in parse
    return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
  File "/home/james/__ws__/dev/pfp/venv3/lib/python3.6/site-packages/py010parser/ply/yacc.py", line 1047, in parseopt_notrack
    tok = self.errorfunc(errtoken)
  File "/home/james/__ws__/dev/pfp/venv3/lib/python3.6/site-packages/py010parser/c_parser.py", line 1952, in p_error
    column=self.clex.find_tok_column(p)))
  File "/home/james/__ws__/dev/pfp/venv3/lib/python3.6/site-packages/py010parser/plyparser.py", line 54, in _parse_error
    raise ParseError("%s: %s" % (coord, msg))
py010parser.plyparser.ParseError: tests/templates/EXE.bt:163:77: before: 2
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

Successfully merging a pull request may close this issue.

1 participant