Closed oskarrrrrrr closed 10 months ago
Raise JsonPathParserError when there is a syntax error at the end of path string. Before, for example, 'foo[*' would raise an AttributeError instead.
The bug was in p_error method, it was assumed that it always got a token but it gets a None whenever the error is at the end of path.
p_error
See: https://ply.readthedocs.io/en/latest/ply.html?highlight=p_error#syntax-error-handling ("if the syntax error is due to reaching the end-of-file, p_error() is called with an argument of None")
@oskarrrrrrr Thanks! Looks great :)
Raise JsonPathParserError when there is a syntax error at the end of path string. Before, for example, 'foo[*' would raise an AttributeError instead.
The bug was in
p_error
method, it was assumed that it always got a token but it gets a None whenever the error is at the end of path.See: https://ply.readthedocs.io/en/latest/ply.html?highlight=p_error#syntax-error-handling ("if the syntax error is due to reaching the end-of-file, p_error() is called with an argument of None")