Closed josephaltmaier closed 2 years ago
I guess that's possible, I think this means changing the scanner methods to all return an extra error
Do you have a minimum breaking example for this?
It actually wasn't yacc that causes this - we allow at-sign in curly braces because according to the specs you can use this for references to other macros, but the problem is if it's not a macro entry we don't know what to do with the at-sign (so error).
I've made it return an error at Parse()
instead of in-line log.Fatal
in v1.1.0, hope this works for you.
Outstanding, thank you! This does solve my problem.
When the parser encounters an unexpected @ sign it does a log.Fatal() with the message "Unexpected @ sign". This seems to be intended behavior. I am trying to use the parser in an app which should not panic when it encounters invalid bibtex. I would prefer to return the error to my app to decide what to do with it. Is this a change other people would be interested in? Is there a preferred way to make this change? I'm happy to do it, but I have been struggling with yacc for some time.