Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position incorrect for Parenthesized expression. #129

Closed
peterhal opened this issue Jan 21, 2014 · 2 comments
Closed

Position incorrect for Parenthesized expression. #129

peterhal opened this issue Jan 21, 2014 · 2 comments

Comments

@peterhal
Copy link

Given a file containing:

(a);

The absolute position of the AstNode will be 1 (the char index of the 'a').
Expected absolute position to be 0 (the index for the '(').

Contrast this with an array literal which has absolute position set correctly:

[a];

@abort
Copy link

abort commented Jun 26, 2014

Noticed the same problem. It seems that it does not cascade over the whole file and it just always deviates with 1 for parenthesized expressions.

@kuzjka
Copy link
Contributor

kuzjka commented Jan 24, 2019

Yes, for example having (a).b(); and extracting function call's target from source string according to node position we got a).b which looks pretty weird.

I'm preparing PR to fix this. We can use constructor with explicit position in Parser#parenExpr(). I'll check if it doesn't brake tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants