本文整理汇总了Java中com.intellij.lang.javascript.JSTokenTypes.ELSE_KEYWORD属性的典型用法代码示例。如果您正苦于以下问题:Java JSTokenTypes.ELSE_KEYWORD属性的具体用法?Java JSTokenTypes.ELSE_KEYWORD怎么用?Java JSTokenTypes.ELSE_KEYWORD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.lang.javascript.JSTokenTypes
的用法示例。
在下文中一共展示了JSTokenTypes.ELSE_KEYWORD属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitIfStatement
@Override
public void visitIfStatement(final ASTNode node)
{
if(type1 == JSTokenTypes.IF_KEYWORD && type2 == JSTokenTypes.LPAR)
{
setSingleSpace(mySettings.SPACE_BEFORE_IF_PARENTHESES);
}
else if(type1 == JSTokenTypes.LPAR || type2 == JSTokenTypes.RPAR)
{
setSingleSpace(mySettings.SPACE_WITHIN_IF_PARENTHESES);
}
else if(type1 == JSTokenTypes.RPAR && type2 == JSElementTypes.BLOCK_STATEMENT)
{
TextRange dependentRange = new TextRange(myParent.getStartOffset(), myChild1.getTextRange().getEndOffset());
setBraceSpace(mySettings.SPACE_BEFORE_IF_LBRACE, mySettings.BRACE_STYLE, dependentRange);
}
else if(type2 == JSTokenTypes.ELSE_KEYWORD)
{
setLineBreakSpace(mySettings.ELSE_ON_NEW_LINE);
}
else if(type1 == JSTokenTypes.ELSE_KEYWORD && type2 == JSElementTypes.BLOCK_STATEMENT)
{
setBraceSpace(mySettings.SPACE_BEFORE_ELSE_LBRACE, mySettings.BRACE_STYLE, null);
}
}
示例2: parseIfStatement
protected void parseIfStatement(final PsiBuilder builder)
{
StatementParsing.LOGGER.assertTrue(builder.getTokenType() == JSTokenTypes.IF_KEYWORD);
final PsiBuilder.Marker ifStatement = builder.mark();
builder.advanceLexer();
Parsing.checkMatches(builder, JSTokenTypes.LPAR, JavaScriptBundle.message("javascript.parser.message.expected.lparen"));
getExpressionParsing().parseExpression(builder);
// handle empty expressions inside
while(builder.getTokenType() == JSTokenTypes.OROR || builder.getTokenType() == JSTokenTypes.EQEQ)
{
builder.advanceLexer();
}
Parsing.checkMatches(builder, JSTokenTypes.RPAR, JavaScriptBundle.message("javascript.parser.message.expected.rparen"));
parseStatement(builder);
if(builder.getTokenType() == JSTokenTypes.ELSE_KEYWORD)
{
builder.advanceLexer();
parseStatement(builder);
}
ifStatement.done(JSElementTypes.IF_STATEMENT);
}