-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parseFully() may still abort parsing #26
Comments
The JBibTeX project relies on parsers that are auto-generated based on grammar files. I'm not sure if it's possible to implement very "deep" error detection and recovery this way at all. There's probably a need for multi-layer/multi-tier parse approach, where the incoming BibTeX data is first segmented using some very robust technology (regexes?), and then these segments are parsed using JBibTeX parsers.
That's a deep structural flaw in the BibTeX data. If you open your BibTeX database file in a BibTeX-aware text editor, does it perform syntax highlighting correctly?
Shouldn't this be caught/handled programmatically by this method (or similar)? |
I agree that non-matching "}" are a deep structural flaw, just like non-matching"{". Unfortunately such errors occur quite often in user data files. If the library is able to deal with one of these errors then it would be nice if it could deal with the other one, too. The problem with references to undefined @string references is that the ObjectResolutionException is not caught, and that parseFully() does not just skip the problematic entry but aborts the total parser run. Citing your project description:
The Javadoc of parseFully() is more cautious ;-)
|
Got that - the parser component does not respect the exceptions raised by itself. Do you have a small self-contained BibTeX database, which could be used for unit testing purposes? |
This should do:
|
LaTexParser.parseFully() is not very robust yet. Yes, it continues parsing when it encounters non-matching "{", but still aborts parsing in the following situations:
@string
declarations, likejournal = siammd
(value without braces and quotation marks)Tested with library versions 1.0.15 and 1.0.19.
The text was updated successfully, but these errors were encountered: