-
Notifications
You must be signed in to change notification settings - Fork 101
Fix the syntax rule (regex) for creating a new instance with a new keyword bug mentioned in issue #116 #117
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 the syntax rule (regex) for creating a new instance with a new keyword bug mentioned in issue #116 #117
Conversation
The problem is mentioned in #116
Still fixing regex...
I find this modification should affect other tests error, like new(...), but it is still working.
Because the space after the new keyword is at least one space.
(Update) I figure out why it works.
"(?>.." is to capture keywords.
So, if we keep the original one, it will detect words with the prefix "new" without blanks. (because it is \s*)
And with \s+, new() is still working because there is a ?<isfunction> regex after that.
Uh oh!
There was an error while loading. Please reload this page.
Modification
Detail
I changed ^new(?>\s*)
to ^new(?>\s+)
Reason
The original regex rule will detect 3 cases.
The original one should not detect the last one.