We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Acorn's loose parser incorrectly parses code if the indentation is not coherent. This problem does not occur with the main parser.
Sorry for the brief report, will update with more details soon (if needed).
sample test:
const acorn = require('acorn'); const { parse_dammit } = require('acorn/dist/acorn_loose'); const escodegen = require('escodegen'); const code = ` { console.log('should be inside block'); console.log('should be inside block'); } console.log('should be outside block'); `; console.log('\n----------- ACORN PARSER -----------'); console.log(escodegen.generate(acorn.parse(code))); console.log('\n-------- ACORN LOOSE PARSER --------'); console.log(escodegen.generate(parse_dammit(code)));
loose parser output:
{ console.log('should be inside block'); } console.log('should be inside block'); console.log('should be outside block');
The text was updated successfully, but these errors were encountered:
That is by design. See #199 for more discussion.
Sorry, something went wrong.
No branches or pull requests
Acorn's loose parser incorrectly parses code if the indentation is not coherent.
This problem does not occur with the main parser.
Sorry for the brief report, will update with more details soon (if needed).
sample test:
loose parser output:
The text was updated successfully, but these errors were encountered: