Comments (6)
FYI: esprima does include the ;
in its range based counting:
http://esprima.org/demo/parse.html?code=var%20x%20%3D%200%3B
(make sure to turn on the "Index-based range" option)
Esprima reports 0-10 for the range (the ranges are apparently "start position to end position, but not including end position"), instead of 0-9.
from acorn.
IMO, the semicolon and any whitespace/comments leading up to it should be included in the range.
from acorn.
I agree this is a bug. Fixed in attached commit.
@michaelficarra No, whitespace around a node definitely will not be included in the node's span.
from acorn.
@marijnh: ... it's internal whitespace. To be clear, I meant this:
var x = 0 ;
^^^^
from acorn.
@michaelficarra Ah, I see. In that case, I am in full agreement. I assumed it in "leading up to it" was the var
statement.
from acorn.
Great, thanks!
from acorn.
Related Issues (20)
- SKG HOT 4
- How does it compare to the speed of vanilla JavaScript? HOT 1
- TypeScript complains when extending Parser HOT 1
- Justin Durand
- [acorn] Missing `value` property in `Token` (TypeScript) HOT 3
- Only fans.com
- Unsupported platform for [email protected] HOT 1
- Import Attributes
- Feature Request: ES2025 RegExp Duplicate named capturing groups HOT 6
- Acorn rejects call expression on the lhs of assignment. HOT 8
- [acorn-walk] Type error when using VariableDeclarator with walk.simple HOT 1
- Property and AssignmentProperty have the same type HOT 1
- Peer dependency on acorn for acorn-walk types HOT 4
- Open
- Broken expression is parsed without errors HOT 2
- विश्व
- [Regression] Does not work in older Node HOT 2
- Jim Morrison Jr
- Jim Morrison Jr HOT 2
- Jim Morrison Jr
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acorn.