-
Notifications
You must be signed in to change notification settings - Fork 43
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
Malformed addition/subtraction don't get parsed as errors #28
Comments
Well, a bit of consistency to start would be nice, wouldn't it :) There are actually two LaTeX parsers involved. The one in MathLive core, and the other in the Compute Engine. The MathLive
They typically represent a syntax error in the input Latex. Despite those errors being signaled, attempt to recover and continue is made. When using the Compute Engine However, while the MathLive parser is purely syntactic, the Compute Engine parser applies some semantic knowledge about what is being parsed. For example, So, when an "error" is encountered, the Compute Engine parser first tries to "fill in the blanks", in particular adding So, in both cases, best attempt is made to interpret the input. In the case of MathLive, the result is biased towards getting something that the editor will be able to display, with the intent that the user could correct whatever problem there may be, and to use a side channel (the 'math-error' event) to notify the client that something not quite right happened. In the case of the Compute Engine, since the idea is that the caller is an API that will do further processing, as much information as possible is provided in the resulting That said, the |
I have a pending fix for this. |
An
|
If you're missing an argument, addition and subtraction parse inconsistently compared to multiplication and division.
I'd be curious to know a bit more about the error-handling philosophy for
parse
. MathLive throwsmath-error
events when it can't parse the latex (including the above four cases). Compute Engine seems to not throw any errors at all inparse
. Is that intentional?The text was updated successfully, but these errors were encountered: