Why do most (at least JS) parsers restrict syntax errors to a single position? eg. only a single column/line, rather than having a range of start/end? The errors would be a lot richer.
-
-
Replying to @sebmck
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.
1 reply 0 retweets 9 likes
Replying to @drosenwasser
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
0 replies
0 retweets
4 likes
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 