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

in keyword is missing #501

Closed
eliasku opened this issue Oct 14, 2016 · 3 comments
Closed

in keyword is missing #501

eliasku opened this issue Oct 14, 2016 · 3 comments

Comments

@eliasku
Copy link
Contributor

eliasku commented Oct 14, 2016

We're still miss in keyword inside lexer and grammar.
For example for(x in y) {}
IN should be highlighted as a keyword

@EBatTiVo
Copy link
Contributor

It's definitely in the BNF:

forStatement ::= 'for' '(' componentName 'in' iterable')' statement ';'?
{mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeForStatementPsiMixinImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeForStatementPsiMixin"}
// XXX: Somehow or another, forStatement must derive from AbstractHaxeNamedComponent, or variable resolution will break.

Colorizing is done in HaxeColorAnnotator.annotate(). There are specific tests for 'new' and 'from/to'.

I am wondering how it is done, for example in case of "for"

for, while, break, throw, switch, etc. are declared as "statement"s in the BNF. They all derive from (Haxe)PsiStatement, colorizing of which must be handled by some magic performed in the IDEA implementation classes.

The trouble with 'in' is that it's not actually a statement in and of itself. It's more of a separator between the variable name and the elements being iterated over.

@EBatTiVo
Copy link
Contributor

#504 has the change.

@EBatTiVo
Copy link
Contributor

Fixed with d670d12.

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

No branches or pull requests

2 participants