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

Incorrect parsing with mixed spaces and tabs #1000

Open
iljapostnovs opened this issue Nov 30, 2020 · 2 comments
Open

Incorrect parsing with mixed spaces and tabs #1000

iljapostnovs opened this issue Nov 30, 2020 · 2 comments

Comments

@iljapostnovs
Copy link

acorn-loose
v8.0.1

Parsing goes wrong when you have mixed spaces and tabs.
Example:

function() {
	 var oModel = aSelectedContexts[0].getModel();
	var asd;
}
test;

Expected:
image
Actual:
image

For some reason declaration of variable "asd" moved to the main body of the program, but it should be inside of the function declaration.

@marijnh
Copy link
Member

marijnh commented Nov 30, 2020

The loose parser is indentation-sensitive. Passing it misindented code will cause it to parse the code incorrectly, and it seems the issue in the example code isn't consistently indented, regardless of whether spaces and tabs are mixed—the second line has a tab and a space, the third only a tab.

@Aungkhant884
Copy link

o

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