Wrong error message in FSPEC generator when parsing LaTeXts
Brought to you by:
han_joosten,
oblosys
Consider the following script
CONTEXT GRCengine IN ENGLISH LATEX PURPOSE CONTEXT GRCengine {+The purpose of this script is [fill in] \begin{itemize} \item first item \item second item \and{itemize} -} ENDCONTEXT
When trying to create an FSPEC, it produces the following text:
ampersand.exe: Error at "source" (line 6, column 1): unexpected end of input expecting white space, "%", new-line, "\\", "{", "-", "``", "\8220", "\"`", "\"", "`", "\ 8216", "''", "\8221", "'", "\8217", "~", "$$", "$", "^", "_", "^^", "&" or \end{itemize} ^
Note that line 6 is the line that says
\item second item
There is nothing wrong with this line
The error is in the next line (line 7)
It would be nice to have a better error message, that provides the correct line.
Also, since this code appears to only be parsed in the FSPEC generator (you can create a prototype with this text without any problem), it would be nice to say something about the specifics of this in the error message as well.
Hmm. Nice catch! This is what currently happens:
The string inbetween the {- and -} symbols is parsed by another parser. (It comes from the Pandoc library). That parser is unaware of anything 'outside' the {+ and -} symbols. So when it mentions a line number, the numbers are counting from the {+ symbol. So in this case it says 'end of line, line 6, column 1. Acually, line 6, when counting from the {+ symbol, is at the -} symbol. (acual line 8). And for the modeller, there is no end of file there at all! From the Ampersand's modeller point of view, this is very confusing!
There are several problems with the thrown error message:
As the indicated priority is already low, do not expect anything to change soon wrt. pandoc parser error messages.
it would already help if Ampersand mentioned that the error message was generated by Pandoc,so you know you have at least some clue, e.g. in cases where this error occurs somwhere in the middle of a large file.
Last edit: Martijn Schrage 2015-02-20
Dit kan aangepakt worden door de output van pandoc te seq'en en daar een catch omheen te zetten. Dan is in ieder geval duidelijk dat de fout niet van Ampersand is.
PS bij het beantwoorden van tickets per mail reply is het slim om de gequote vorige mails te verwijderen, aangezien die anders allemaal meerdere keren in het ticket terechtkomen. (zie hierboven)