You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but of course that naive solution only works if there is only one missing or extraneous token, so "if true; x ? true : foo ))))) elseif true end" will break it again.
Generally, this should be solvable by an arbitrarily long look-ahead for continuation keywords, but I really don't like that solution (and it might not even work in all cases).
The text was updated successfully, but these errors were encountered:
Generally, this should be solvable by an arbitrarily long look-ahead for continuation keywords
If we cap the lookahead at some large but not huge value I feel this is acceptable. But recovery and error reporting really is hard: in general it requires both look ahead and look behind to do a good job.
Any parsing algorithm which assumes the source is "well-formed by default" is likely to enter weird states where there's not enough local information available in the program to emit the ideal error. Hence wanting #93 or something similar... (really, I believe parsing of broken text and emitting error messages and warnings are in the "big pile of heuristics" category of software which in general is better learned with a data driven ML approach... but that would be a research project ...)
Consider
This special case is fixed by #77 by punting the
elseif
into the containing block instead:but of course that naive solution only works if there is only one missing or extraneous token, so
"if true; x ? true : foo ))))) elseif true end"
will break it again.Generally, this should be solvable by an arbitrarily long look-ahead for continuation keywords, but I really don't like that solution (and it might not even work in all cases).
The text was updated successfully, but these errors were encountered: