Skip to content

block statement #596

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

Merged
merged 10 commits into from
Aug 16, 2016
Merged

block statement #596

merged 10 commits into from
Aug 16, 2016

Conversation

bounceme
Copy link
Collaborator

shouldn't be too difficult

@bounceme
Copy link
Collaborator Author

bounceme commented Aug 14, 2016

So this works fine, it's just really slow right now and i have no idea why. also this is what this pr changes:

{
  var i = 0,
    l = 5
}
// vs (as if it were an object)
{
  var i = 0,
  l = 5
}

@bounceme
Copy link
Collaborator Author

bounceme commented Aug 15, 2016

so there is a slight decrease in performance with this pr however this uses the same algorithm from https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader which the acorn parser also uses. it actually is basically the same as what i had originally but with support for labeled block statements and plain block statements.

My results with https://github.com/sanctuary-js/sanctuary-def/blob/master/index.js

block : 10.327 seconds
dev : 8.689 seconds

`8.679 seconds`

how? I don't see why direction should matter if the patterns explicitly match against the cursor position. The `W` flag also helped
if this improved performance
@bounceme
Copy link
Collaborator Author

will probably merge this tomorrow evening after some more testing

@bounceme bounceme merged commit 28b5a87 into develop Aug 16, 2016
@bounceme bounceme deleted the block branch August 16, 2016 01:44
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

Successfully merging this pull request may close these issues.

1 participant