I’ve always assumed it was bc once they encountered that error they couldn’t parse the rest of the document and find the end position. Might be a naive take on it though.
-
-
-
This rarely, if ever, happens in practice—a good parser tries as hard as it can to “recover” from input it doesn’t understand. That’s how, in your favorite editor, you can type something totally bananas, then go back to writing valid JS and only the bad part has red squigglies.
- 4 more replies
New conversation -
-
-
Don't they? TypeScript has it, though it only presents line/col on the command line. You can see that it's a full range if you use --pretty though.
-
Oh nice! Acorn: https://github.com/acornjs/acorn/blob/d3c42927398e2c0876c2ac70a3c14da7aef85736/acorn/src/location.js#L12-L18 … Esprima: https://github.com/jquery/esprima/blob/master/src/error-handler.ts#L49-L56 … Babel parser: https://github.com/babel/babel/blob/master/packages/babel-parser/src/parser/location.js#L13-L39 … Not the ones I'm familiar with unfortunately
End of conversation
New conversation -
-
-
-
Can't speak for others. I just see an error and bail in mine. Right now haven't given it much thought or work. Ah heck, I don't even have line/col info in my tokens or ast at all :p
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Maybe lazy...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 