Closed TheZoq2 closed 4 years ago
Oh yea, like the previous pair of PRs, this one also includes the changes from #8
I really don't mind! I am happy that someone finds the stuff I did somewhat useful! Thanks for the PR! It looks good to me!
And at the same time, it seems it's closing #1 at the same time. @rubdos Pinging you because you might be interested by what @TheZoq2 did..
Cool stuff, thanks for the heads up :-)
I hope you don't mind my PR spam :) This one is a bit larger than the previous one, I hope you dont mind that either.
In #8 I mentioned that the point of that PR originally was to gain access to the
VerboseError
stuff from nom 0.5 which ultimately failed. The reason it failed was that those macros define functions that return(I, ErrorKind)
which is not very useful. In order to fix it, I made the parser functions generic over the error type. I also had to add some extra macros todo_parse!
macro defined by nom which doesn't work.delimited(multispace0, <some parser>, multispace0)
everywhereIn order to make debugging even easier, I also added the
nom_traceable
crate along with a new feature calledtrace
which allows printing of the work that the parsers do. This is primarily intended for development of the crate itself.The structure of the parser is largely the same with some tiny differences. The tests remain the same, but I had to change the types for obvious reasons. I added a few new tests to debug issues I found, and finally I removed a test that said
@preamble {my vars}
should parse. As far as I can tell, that structure is not supported without quotes, and it caused issues. If that should be supported, let me know :)