Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Improve function-params regex #184

Merged
merged 2 commits into from
Aug 2, 2015
Merged

Improve function-params regex #184

merged 2 commits into from
Aug 2, 2015

Conversation

winstliu
Copy link
Contributor

@winstliu winstliu commented Aug 1, 2015

The function-params regex was very archaic and hard to understand, so I've replaced it with a system that doesn't have nested patterns and can be easily expanded upon. It's also much more robust than the previous system in that it tokenizes brackets, strings, numbers, and more.

In addition, I've also added a new regex rule called entity.name.constructor.js for tokenizing constructor()-type functions. The name can probably be improved :).

Fixes #183.

In addition, add a constructor regex
-Fixes #183
@winstliu
Copy link
Contributor Author

winstliu commented Aug 1, 2015

@bucaran this should fix both your issues - I added in your constructor as a new spec 😄.

/cc @Victorystick if you want to take a look.

@ghost
Copy link

ghost commented Aug 1, 2015

👏 Awesome.

'numbers':
'patterns': [
{
'match': '\\b((0(x|X)[0-9a-fA-F]+)|(0(b|B)[01]+)|(0(o|O)[0-7]+)|([0-9]+(\\.[0-9]+)?)((e|E)[+-]?[0-9]+)?)\\b'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can JavaScript decimal literals have an optional sign on the front of them too? Or is it like in Python where there are only positive literals that get negated?

@lee-dohm
Copy link
Contributor

lee-dohm commented Aug 2, 2015

Looks good to me ⛵

winstliu pushed a commit that referenced this pull request Aug 2, 2015
Improve function-params regex
@winstliu winstliu merged commit ee4e050 into master Aug 2, 2015
@winstliu winstliu deleted the wl-function-params branch August 2, 2015 00:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants