Thanks for the observation.
Actually, that's the way it works.
All over the place in the syntax decoder, you need to try one possible branch or another.
The syntax_backtrack exception gives the way out of a branch. o_final is false when we do this. When we know exactly what we will have, we put o_final to true and go further.
Take care
Yves
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have changed the logic in 1.2.1 to avoid throwing exceptions in the regular case.
There's only exceptions in case of syntax error or malfunction now.
Yves
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The project status has been upgraded to beta, as we have now a usable engine.
Try it, and get back to us if you encounter any problem with it.
This is pretty fiendish stuff!
An early observation:
if (! ltp_get (0) || ltp_get (0) -> lex_get_value () != lex_ncname)
throw syntax_error ("[XML 6/1]");
in xpath_syntax.cpp throws all the way through the test set, caught at the bottom of the function:
catch (syntax_error s2)
{
if (! o_final)
throw syntax_backtrack (s2);
throw;
}
.. which usually throws syntax_backtrace since o_final is null.
On first site it looks like a parser error is being hidden.
Otherwise it seems to work for me.
hope this helps,
-Simon.
Thanks for the observation.
Actually, that's the way it works.
All over the place in the syntax decoder, you need to try one possible branch or another.
The syntax_backtrack exception gives the way out of a branch. o_final is false when we do this. When we know exactly what we will have, we put o_final to true and go further.
Take care
Yves
I have changed the logic in 1.2.1 to avoid throwing exceptions in the regular case.
There's only exceptions in case of syntax error or malfunction now.
Yves