当前位置: 首页>>代码示例>>Java>>正文


Java JSTokenTypes.FOR_KEYWORD属性代码示例

本文整理汇总了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");
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:20,代码来源:StatementParsing.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:26,代码来源:JSSpacingProcessor.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:21,代码来源:JSSpacingProcessor.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:36,代码来源:ExpressionParsing.java


注:本文中的com.intellij.lang.javascript.JSTokenTypes.FOR_KEYWORD属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。