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

Fix tokenizer's bracket pairs' open stack #693

Merged
merged 2 commits into from
May 26, 2015
Merged

Fix tokenizer's bracket pairs' open stack #693

merged 2 commits into from
May 26, 2015

Conversation

redapple
Copy link
Contributor

I found this bug while parsing things like:

for (index in [1,2,3]) /^salign$/i.test('salign')

(from rspivak/slimit#54)

Before the fix, you get:

for (index in [1, 2, 3]) / ^ salign$ / i.test('salign')

The regular expression is not detected.

With this fix, the regular expression literal is kept as-is:

>>> import jsbeautifier
>>> print jsbeautifier.beautify("for (index in [1,2,3]) /^salign$/i.test('salign')")
for (index in [1,2,3]) /^salign$/i.test('salign')
>>> 

@bitwiseman bitwiseman added this to the v1.5.6 milestone May 26, 2015
bitwiseman added a commit that referenced this pull request May 26, 2015
Fix tokenizer's bracket pairs' open stack
@bitwiseman bitwiseman merged commit 208eed7 into beautifier:master May 26, 2015
@bitwiseman
Copy link
Member

Strange symptom. Good catch on the fix though, thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants