本文整理汇总了Java中com.intellij.lang.javascript.JSTokenTypes.FOR_KEYWORD属性的典型用法代码示例。如果您正苦于以下问题:Java JSTokenTypes.FOR_KEYWORD属性的具体用法?Java JSTokenTypes.FOR_KEYWORD怎么用?Java JSTokenTypes.FOR_KEYWORD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.lang.javascript.JSTokenTypes
的用法示例。
在下文中一共展示了JSTokenTypes.FOR_KEYWORD属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseIterationStatement
protected void parseIterationStatement(final PsiBuilder builder)
{
final IElementType tokenType = builder.getTokenType();
if(tokenType == JSTokenTypes.DO_KEYWORD)
{
parseDoWhileStatement(builder);
}
else if(tokenType == JSTokenTypes.WHILE_KEYWORD)
{
parseWhileStatement(builder);
}
else if(tokenType == JSTokenTypes.FOR_KEYWORD)
{
parseForStatement(builder);
}
else
{
StatementParsing.LOGGER.error("Unknown iteration statement");
}
}
示例2: visitForStatement
@Override
public void visitForStatement(final ASTNode node)
{
if(type1 == JSTokenTypes.SEMICOLON)
{
setSingleSpace(true);
}
else if(type2 == JSTokenTypes.SEMICOLON)
{
setSingleSpace(mySettings.SPACE_BEFORE_SEMICOLON);
}
if(type1 == JSTokenTypes.FOR_KEYWORD && type2 == JSTokenTypes.LPAR)
{
setSingleSpace(mySettings.SPACE_BEFORE_FOR_PARENTHESES);
}
else if(type1 == JSTokenTypes.RPAR && type2 == JSElementTypes.BLOCK_STATEMENT)
{
TextRange dependentRange = new TextRange(myParent.getStartOffset(), myChild1.getTextRange().getEndOffset());
setBraceSpace(mySettings.SPACE_BEFORE_FOR_LBRACE, mySettings.BRACE_STYLE, dependentRange);
}
else if(type1 == JSTokenTypes.LPAR || type2 == JSTokenTypes.RPAR)
{
setSingleSpace(mySettings.SPACE_WITHIN_FOR_PARENTHESES);
}
}
示例3: visitForInStatement
@Override
public void visitForInStatement(final ASTNode node)
{
if(type1 == JSTokenTypes.VAR_KEYWORD || type2 == JSTokenTypes.VAR_KEYWORD)
{
setSingleSpace(true);
}
else if(type1 == JSTokenTypes.FOR_KEYWORD && type2 == JSTokenTypes.LPAR)
{
setSingleSpace(mySettings.SPACE_BEFORE_FOR_PARENTHESES);
}
else if(type1 == JSTokenTypes.RPAR && type2 == JSElementTypes.BLOCK_STATEMENT)
{
TextRange dependentRange = new TextRange(myParent.getStartOffset(), myChild1.getTextRange().getEndOffset());
setBraceSpace(mySettings.SPACE_BEFORE_FOR_LBRACE, mySettings.BRACE_STYLE, dependentRange);
}
else if(type1 == JSTokenTypes.LPAR || type2 == JSTokenTypes.RPAR)
{
setSingleSpace(mySettings.SPACE_WITHIN_FOR_PARENTHESES);
}
}
示例4: parseConditionalExpression
private boolean parseConditionalExpression(final PsiBuilder builder, final boolean allowIn)
{
final PsiBuilder.Marker expr = builder.mark();
if(!parseORExpression(builder, allowIn))
{
expr.drop();
return false;
}
final IElementType nextTokenType = builder.getTokenType();
if(nextTokenType == JSTokenTypes.QUEST)
{
builder.advanceLexer();
if(!parseAssignmentExpression(builder, allowIn))
{
builder.error(JavaScriptBundle.message("javascript.parser.message.expected.expression"));
}
Parsing.checkMatches(builder, JSTokenTypes.COLON, JavaScriptBundle.message("javascript.parser.message.expected.colon"));
if(!parseAssignmentExpression(builder, allowIn))
{
builder.error(JavaScriptBundle.message("javascript.parser.message.expected.expression"));
}
expr.done(JSElementTypes.CONDITIONAL_EXPRESSION);
}
else if(nextTokenType == JSTokenTypes.FOR_KEYWORD && builder.getUserData(WITHIN_ARRAY_LITERAL_EXPRESSION) != null)
{
getStatementParsing().parseForLoopHeader(builder); // TODO: make it more clear
expr.done(JSElementTypes.CONDITIONAL_EXPRESSION);
}
else
{
expr.drop();
}
return true;
}