Functions that have other functions as the second or higher argument cannot be parsed.
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
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)'