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

Conversation

@Alhadis
Copy link
Contributor

@Alhadis Alhadis commented Nov 23, 2016

Fixes the issues brought up by @bgriffith in #460, as well as another I noticed while filling out specs:

import { default as alias };

import
{
default
as
alias
};

@winstliu
Copy link
Contributor

/cc @MaximSokolov

}
{
'match': '\\b([a-zA-Z_$][\\w$]*)\\b(?=.*\\bfrom\\b)'
'match': '\\b([a-zA-Z_$][\\w$]*)\\b(?=.*(?:$|\\bfrom\\b))'
Copy link
Contributor

Choose a reason for hiding this comment

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

(?=.*(?:$|\\bfrom\\b)) is not needed here


lines = grammar.tokenizeLines """
import
\\x20{2}
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be \x20\x20. I don't think testing for whitespaces is necessary, as it's already separated by lines

Copy link
Contributor Author

@Alhadis Alhadis Nov 26, 2016

Choose a reason for hiding this comment

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

The whitespace is only to stop the whitespace package stripping empty lines or something, which is what @50Wliu pointed out in another pull request.

The blank lines are also to ensure multiline-matching isn't restricted to the following line only.

Not sure how I managed to get the \x20{2} part wrong either... guess I must've been thinking in regex-mode, heh.


lines = grammar.tokenizeLines """
import
\\t
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor

Choose a reason for hiding this comment

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

Also \\t -> \t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I clearly can't edit a language grammar while compiling a V8 build, it seems. )))))))))))

Pushed an amended commit.


lines = grammar.tokenizeLines """
import
\\x20
Copy link
Contributor

Choose a reason for hiding this comment

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

It's should be \x20 not \\x20. You can add test for lines[1][0] to make sure


lines = grammar.tokenizeLines """
import
\\x20{2}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also here

}
\\t
from
\\t
Copy link
Contributor

Choose a reason for hiding this comment

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

And here

CSON-based grammars are poisonous to the mind and must die.
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.

4 participants