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


Java JSTokenTypes.AS_KEYWORD属性代码示例

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


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

示例1: parseIsAsExpression

private boolean parseIsAsExpression(final PsiBuilder builder)
{
	PsiBuilder.Marker expr = builder.mark();
	if(!parseUnaryExpression(builder))
	{
		expr.drop();
		return false;
	}

	while(builder.getTokenType() == JSTokenTypes.AS_KEYWORD || builder.getTokenType() == JSTokenTypes.IS_KEYWORD)
	{
		builder.advanceLexer();
		if(!parseUnaryExpression(builder))
		{
			builder.error(JavaScriptBundle.message("javascript.parser.message.expected.expression"));
		}
		expr.done(JSElementTypes.BINARY_EXPRESSION);
		expr = expr.precede();
	}

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

示例2: parsePrimaryExpression

@Override
public boolean parsePrimaryExpression() {
    final IElementType firstToken = builder.getTokenType();
    if (firstToken == JSTokenTypes.STRING_LITERAL) {
        return parseStringLiteral(firstToken);
    }
    if (firstToken == JSTokenTypes.IDENTIFIER && builder.lookAhead(1) == JSTokenTypes.AS_KEYWORD) {
        return parseAsExpression();
    }
    return super.parsePrimaryExpression();
}
 
开发者ID:kristianmandrup,项目名称:emberjs-plugin,代码行数:11,代码来源:EmberJSParser.java

示例3: isExprInTypeContext

public static boolean isExprInTypeContext(final JSReferenceExpression expr)
{
	final PsiElement parent = expr.getParent();

	return isExprInStrictTypeContext(expr) ||
			parent instanceof JSNewExpression ||
			parent instanceof JSUseNamespaceDirective ||
			(parent instanceof JSBinaryExpression &&
					((JSBinaryExpression) parent).getROperand() == expr &&
					(((JSBinaryExpression) parent).getOperationSign() == JSTokenTypes.IS_KEYWORD || ((JSBinaryExpression) parent).getOperationSign() == JSTokenTypes.AS_KEYWORD));
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:11,代码来源:JSResolveUtil.java

示例4: getSpaceAroundOption

private boolean getSpaceAroundOption(final IElementType opSign)
{
	boolean option = false;
	if(JSTokenTypes.ADDITIVE_OPERATIONS.contains(opSign))
	{
		option = mySettings.SPACE_AROUND_ADDITIVE_OPERATORS;
	}
	else if(JSTokenTypes.MULTIPLICATIVE_OPERATIONS.contains(opSign))
	{
		option = mySettings.SPACE_AROUND_MULTIPLICATIVE_OPERATORS;
	}
	else if(JSTokenTypes.ASSIGNMENT_OPERATIONS.contains(opSign))
	{
		option = mySettings.SPACE_AROUND_ASSIGNMENT_OPERATORS;
	}
	else if(JSTokenTypes.EQUALITY_OPERATIONS.contains(opSign))
	{
		option = mySettings.SPACE_AROUND_EQUALITY_OPERATORS;
	}
	else if(JSTokenTypes.RELATIONAL_OPERATIONS.contains(opSign))
	{
		option = mySettings.SPACE_AROUND_RELATIONAL_OPERATORS;
	}
	else if(JSTokenTypes.SHIFT_OPERATIONS.contains(opSign))
	{
		option = mySettings.SPACE_AROUND_BITWISE_OPERATORS;
	}
	else if(opSign == JSTokenTypes.ANDAND || opSign == JSTokenTypes.OROR)
	{
		option = mySettings.SPACE_AROUND_LOGICAL_OPERATORS;
	}
	else if(opSign == JSTokenTypes.OR || opSign == JSTokenTypes.AND || opSign == JSTokenTypes.XOR)
	{
		option = mySettings.SPACE_AROUND_BITWISE_OPERATORS;
	}
	else if(opSign == JSTokenTypes.IS_KEYWORD || opSign == JSTokenTypes.AS_KEYWORD)
	{
		option = true;
	}
	return option;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:41,代码来源:JSSpacingProcessor.java


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