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


Java JSTokenTypes.DEFAULT_KEYWORD属性代码示例

本文整理汇总了Java中com.intellij.lang.javascript.JSTokenTypes.DEFAULT_KEYWORD属性的典型用法代码示例。如果您正苦于以下问题:Java JSTokenTypes.DEFAULT_KEYWORD属性的具体用法?Java JSTokenTypes.DEFAULT_KEYWORD怎么用?Java JSTokenTypes.DEFAULT_KEYWORD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.lang.javascript.JSTokenTypes的用法示例。


在下文中一共展示了JSTokenTypes.DEFAULT_KEYWORD属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseCaseOrDefaultClause

private void parseCaseOrDefaultClause(final PsiBuilder builder)
{
	final IElementType firstToken = builder.getTokenType();
	final PsiBuilder.Marker clause = builder.mark();
	if(firstToken != JSTokenTypes.CASE_KEYWORD && firstToken != JSTokenTypes.DEFAULT_KEYWORD)
	{
		builder.error(JavaScriptBundle.message("javascript.parser.message.expected.catch.or.default"));
	}
	builder.advanceLexer();
	if(firstToken == JSTokenTypes.CASE_KEYWORD)
	{
		getExpressionParsing().parseExpression(builder);
	}
	Parsing.checkMatches(builder, JSTokenTypes.COLON, JavaScriptBundle.message("javascript.parser.message.expected.colon"));
	while(true)
	{
		IElementType token = builder.getTokenType();
		if(token == null || token == JSTokenTypes.CASE_KEYWORD || token == JSTokenTypes.DEFAULT_KEYWORD || token == JSTokenTypes.RBRACE)
		{
			break;
		}
		parseStatement(builder);
	}
	clause.done(JSElementTypes.CASE_CLAUSE);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:25,代码来源:StatementParsing.java

示例2: parseQualifiedTypeName

public boolean parseQualifiedTypeName(PsiBuilder builder, boolean allowStar)
{
	if(!JSTokenTypes.IDENTIFIER_TOKENS_SET.contains(builder.getTokenType()))
	{
		return false;
	}
	PsiBuilder.Marker expr = builder.mark();
	Parsing.buildTokenElement(JSElementTypes.REFERENCE_EXPRESSION, builder);

	while(builder.getTokenType() == JSTokenTypes.DOT)
	{
		boolean stop = false;
		builder.advanceLexer();

		final IElementType tokenType = builder.getTokenType();
		if(tokenType == JSTokenTypes.ANY_IDENTIFIER && allowStar)
		{
			builder.advanceLexer();
			stop = true;
		}
		else if(tokenType == JSTokenTypes.DEFAULT_KEYWORD || (tokenType != JSTokenTypes.IDENTIFIER && JSTokenTypes.IDENTIFIER_TOKENS_SET
				.contains(tokenType)))
		{
			builder.advanceLexer(); // TODO: allow any keyword
		}
		else
		{
			Parsing.checkMatches(builder, JSTokenTypes.IDENTIFIER, JavaScriptBundle.message("javascript.parser.message.expected.name"));
		}
		expr.done(JSElementTypes.REFERENCE_EXPRESSION);
		expr = expr.precede();

		if(stop)
		{
			break;
		}
	}

	expr.drop();
	return true;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:41,代码来源:ExpressionParsing.java

示例3: parseQualifiedTypeName

@Override
public boolean parseQualifiedTypeName(PsiBuilder builder, boolean allowStar)
{
	if(!JSTokenTypes.IDENTIFIER_TOKENS_SET.contains(builder.getTokenType()))
	{
		return false;
	}
	PsiBuilder.Marker expr = builder.mark();
	buildTokenElement(JSElementTypes.REFERENCE_EXPRESSION, builder);
	boolean hasGenerics = false;

	while(builder.getTokenType() == JSTokenTypes.DOT)
	{
		boolean stop = false;
		builder.advanceLexer();

		final IElementType tokenType = builder.getTokenType();
		if(tokenType == JSTokenTypes.ANY_IDENTIFIER && allowStar)
		{
			builder.advanceLexer();
			stop = true;
		}
		else if(tokenType == JSTokenTypes.LT)
		{
			parseGenericSignature(builder);
			stop = true;
			hasGenerics = true;
		}
		else if(tokenType == JSTokenTypes.DEFAULT_KEYWORD || (tokenType != JSTokenTypes.IDENTIFIER && JSTokenTypes.IDENTIFIER_TOKENS_SET
				.contains(tokenType)))
		{
			builder.advanceLexer(); // TODO: allow any keyword
		}
		else
		{
			checkMatches(builder, JSTokenTypes.IDENTIFIER, JavaScriptBundle.message("javascript.parser.message.expected.name"));
		}
		expr.done(JSElementTypes.REFERENCE_EXPRESSION);
		expr = expr.precede();

		if(stop)
		{
			break;
		}
	}

	if(!hasGenerics && builder.getTokenType() == JSTokenTypes.LT)
	{
		parseGenericSignature(builder);
		expr.done(JSElementTypes.REFERENCE_EXPRESSION);
	}
	else
	{
		expr.drop();
	}
	return true;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:57,代码来源:EcmaScript4ExpressionParsing.java


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