2 ms·
Well, in a pure sense, you are correct. But for practical reasons, it can sometimes be easier to define a parsing grammar that is a little loose, and pick up t
by dbcurtis 7y ago
Well, in a pure sense, you are correct. But for practical reasons, it can sometimes be easier to define a parsing grammar that is a little loose, and pick up the stragglers by analyzing the AST. Sometimes the “correct”
grammar is needlessly complex and you can reduce the headaches with a quick sanitation pass over the results of a less pure parser.
- lilyball 7y agoEven so, I wouldn't consider this a syntax error, because the error isn't with the syntax but with using an identifier in a context where that particular identifier isn't allowed (but others are). This would make it more akin to a NameError.