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

XPath parser fails to parse functions that have other functions as the second or higher argument #45

Open
altin opened this issue Jan 19, 2021 · 0 comments

Comments

@altin
Copy link

altin commented Jan 19, 2021

Functions that have other functions as the second or higher argument cannot be parsed.

Example:

from eulxml import xpath
ast = xpath.parse('foo(a,b,c,d)') # ok
ast = xpath.parse('foo(current(),b,c,d)') # ok
ast = xpath.parse('foo(a,current(),c,d)') # error

Stack trace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/eulxml/xpath/core.py", line 154, in parse
    return parser.parse(xpath, lexer=lexer)
  File "/eulxml/env/lib/python3.8/site-packages/ply/yacc.py", line 333, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/eulxml/env/lib/python3.8/site-packages/ply/yacc.py", line 1201, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/eulxml/env/lib/python3.8/site-packages/ply/yacc.py", line 192, in call_errorfunc
    r = errorfunc(token)
  File "/eulxml/eulxml/xpath/parserules.py", line 375, in p_error
    raise RuntimeError("Syntax error at '%s'" % repr(p))
RuntimeError: Syntax error at 'LexToken(OPEN_PAREN,'(',1,13)'
LewisW added a commit to LewisW/eulxml that referenced this issue Feb 23, 2024
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