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


Java JSTokenTypes.COMMA属性代码示例

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


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

示例1: parseKeyValue

private void parseKeyValue() {
    builder.advanceLexer();
    final PsiBuilder.Marker comma = builder.mark();
    parseExplicitIdentifierWithError();
    if (builder.getTokenType() == JSTokenTypes.COMMA) {
        builder.advanceLexer();
    } else {
        builder.error(JSBundle.message("javascript.parser.message.expected.comma"));
    }
    parseExplicitIdentifierWithError();
    comma.done(JSElementTypes.COMMA_EXPRESSION);
    if (builder.getTokenType() == JSTokenTypes.RPAR) {
        builder.advanceLexer();
    } else {
        builder.error(JSBundle.message("javascript.parser.message.expected.rparen"));
    }
}
 
开发者ID:kristianmandrup,项目名称:emberjs-plugin,代码行数:17,代码来源:EmberJSParser.java

示例2: parseReferenceList

private void parseReferenceList(final PsiBuilder builder)
{
	final IElementType tokenType = builder.getTokenType();
	EcmaScript4StatementParsing.LOGGER.assertTrue(tokenType == JSTokenTypes.EXTENDS_KEYWORD || tokenType == JSTokenTypes.IMPLEMENTS_KEYWORD);
	final PsiBuilder.Marker referenceList = builder.mark();
	builder.advanceLexer();

	if(getExpressionParsing().parseQualifiedTypeName(builder))
	{
		while(builder.getTokenType() == JSTokenTypes.COMMA)
		{
			builder.advanceLexer();
			if(!getExpressionParsing().parseQualifiedTypeName(builder))
			{
				break;
			}
		}
	}
	referenceList.done(tokenType == JSTokenTypes.EXTENDS_KEYWORD ? JSElementTypes.EXTENDS_LIST : JSElementTypes.IMPLEMENTS_LIST);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:20,代码来源:EcmaScript4StatementParsing.java

示例3: parseLetExpressionStart

PsiBuilder.Marker parseLetExpressionStart(final PsiBuilder builder)
{
	StatementParsing.LOGGER.assertTrue(builder.getTokenType() == JSTokenTypes.LET_KEYWORD);
	final PsiBuilder.Marker marker = builder.mark();
	builder.advanceLexer();

	if(builder.getTokenType() == JSTokenTypes.LPAR)
	{
		builder.advanceLexer();

		if(getExpressionParsing().parseAssignmentExpression(builder))
		{
			while(builder.getTokenType() == JSTokenTypes.COMMA)
			{
				builder.advanceLexer();
				if(!getExpressionParsing().parseAssignmentExpression(builder))
				{
					break;
				}
			}
		}
		Parsing.checkMatches(builder, JSTokenTypes.RPAR, JavaScriptBundle.message("javascript.parser.message.expected.rparen"));
	}
	return marker;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:25,代码来源:StatementParsing.java

示例4: visitJSArrayLiteralExpression

@Override
public void visitJSArrayLiteralExpression(final JSArrayLiteralExpression node)
{
	final PsiElement lastChild = node.getLastChild();
	PsiElement child = lastChild != null ? lastChild.getPrevSibling() : null;
	if(child instanceof PsiWhiteSpace)
	{
		child = child.getPrevSibling();
	}
	ASTNode childNode;

	if(child != null && (childNode = child.getNode()) != null && childNode.getElementType() == JSTokenTypes.COMMA)
	{
		final Annotation annotation = myHolder.createWarningAnnotation(child, JavaScriptBundle.message("javascript.validation.message.unneeded.comma"));
		annotation.registerFix(new RemoveASTNodeFix(childNode, "javascript.validation.message.remove.unneeded.comma.fix"));
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:17,代码来源:JSAnnotatingVisitor.java

示例5: visitParameterList

@Override
public void visitParameterList(final ASTNode node)
{
	if(type1 == JSTokenTypes.LPAR && type2 == JSTokenTypes.RPAR)
	{
		setSingleSpace(false);
	}
	else if(type1 == JSTokenTypes.LPAR || type2 == JSTokenTypes.RPAR)
	{
		setSingleSpace(mySettings.SPACE_WITHIN_METHOD_PARENTHESES);
	}
	else if(type1 == JSTokenTypes.COMMA)
	{
		setSingleSpace(mySettings.SPACE_AFTER_COMMA);
	}
	else if(type2 == JSTokenTypes.COMMA)
	{
		setSingleSpace(mySettings.SPACE_BEFORE_COMMA);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:20,代码来源:JSSpacingProcessor.java

示例6: visitArgumentList

@Override
public void visitArgumentList(final ASTNode node)
{
	if(type1 == JSTokenTypes.LPAR || type2 == JSTokenTypes.RPAR)
	{
		setSingleSpace(false);
	}
	else if(type1 == JSTokenTypes.COMMA)
	{
		setSingleSpace(mySettings.SPACE_AFTER_COMMA);
	}
	else if(type2 == JSTokenTypes.COMMA)
	{
		setSingleSpace(mySettings.SPACE_BEFORE_COMMA);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:16,代码来源:JSSpacingProcessor.java

示例7: parseObjectLiteralExpression

public void parseObjectLiteralExpression(final PsiBuilder builder)
{
	ExpressionParsing.LOGGER.assertTrue(builder.getTokenType() == JSTokenTypes.LBRACE);
	final PsiBuilder.Marker expr = builder.mark();
	builder.advanceLexer();

	IElementType elementType = builder.getTokenType();

	while(elementType != JSTokenTypes.RBRACE && elementType != null)
	{
		parseProperty(builder);

		elementType = builder.getTokenType();
		if(elementType == JSTokenTypes.RBRACE)
		{
			break;
		}
		else if(elementType == JSTokenTypes.COMMA)
		{
			builder.advanceLexer();
		}
		else
		{
			builder.error(JavaScriptBundle.message("javascript.parser.message.expected.comma"));
		}

		elementType = builder.getTokenType();
		if(elementType == JSTokenTypes.RBRACE)
		{
			builder.error(JavaScriptBundle.message("javascript.parser.property.expected"));
		}
		else if(isNotPropertyStart(builder, elementType))
		{
			break;
		}
	}

	Parsing.checkMatches(builder, JSTokenTypes.RBRACE, JavaScriptBundle.message("javascript.parser.message.expected.rbrace"));
	expr.done(JSElementTypes.OBJECT_LITERAL_EXPRESSION);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:40,代码来源:ExpressionParsing.java

示例8: parseArgumentList

protected void parseArgumentList(final PsiBuilder builder)
{
	ExpressionParsing.LOGGER.assertTrue(builder.getTokenType() == JSTokenTypes.LPAR);
	final PsiBuilder.Marker arglist = builder.mark();
	builder.advanceLexer();
	boolean first = true;
	while(builder.getTokenType() != JSTokenTypes.RPAR)
	{
		if(first)
		{
			first = false;
		}
		else
		{
			if(builder.getTokenType() == JSTokenTypes.COMMA)
			{
				builder.advanceLexer();
			}
			else
			{
				builder.error(JavaScriptBundle.message("javascript.parser.message.expected.comma.or.rparen"));
				break;
			}
		}
		if(!parseAssignmentExpression(builder))
		{
			builder.error(JavaScriptBundle.message("javascript.parser.message.expected.expression"));
		}
	}

	Parsing.checkMatches(builder, JSTokenTypes.RPAR, JavaScriptBundle.message("javascript.parser.message.expected.rparen"));
	arglist.done(JSElementTypes.ARGUMENT_LIST);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:33,代码来源:ExpressionParsing.java

示例9: parseExpressionOptional

public boolean parseExpressionOptional(final PsiBuilder builder, final boolean allowIn)
{
	PsiBuilder.Marker expr = builder.mark();
	if(!parseAssignmentExpression(builder, allowIn))
	{
		expr.drop();
		return false;
	}

	if(builder.getTokenType() == JSTokenTypes.IN_KEYWORD)
	{
		expr.done(JSElementTypes.DEFINITION_EXPRESSION);
		return true;
	}

	while(builder.getTokenType() == JSTokenTypes.COMMA)
	{
		builder.advanceLexer();
		if(!parseAssignmentExpression(builder, allowIn))
		{
			builder.error(JavaScriptBundle.message("javascript.parser.message.expected.expression"));
		}

		expr.done(JSElementTypes.COMMA_EXPRESSION);
		expr = expr.precede();
	}

	expr.drop();

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

示例10: parseVarStatementNoMarker

protected void parseVarStatementNoMarker(final PsiBuilder builder, final boolean inForInitializationContext, final @NotNull PsiBuilder.Marker var)
{
	final IElementType declType = builder.getTokenType();
	StatementParsing.LOGGER.assertTrue(declType == JSTokenTypes.VAR_KEYWORD ||
			declType == JSTokenTypes.CONST_KEYWORD ||
			declType == JSTokenTypes.LET_KEYWORD);

	builder.advanceLexer();
	boolean first = true;
	while(true)
	{
		if(first)
		{
			first = false;
		}
		else
		{
			Parsing.checkMatches(builder, JSTokenTypes.COMMA, JavaScriptBundle.message("javascript.parser.message.expected.comma"));
		}

		parseVarDeclaration(builder, !inForInitializationContext);

		if(builder.getTokenType() != JSTokenTypes.COMMA)
		{
			break;
		}
	}

	if(!inForInitializationContext)
	{
		checkForSemicolon(builder);
	}

	var.done(JSElementTypes.VAR_STATEMENT);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:35,代码来源:StatementParsing.java

示例11: parseObjectLiteralExpression

public void parseObjectLiteralExpression(final PsiBuilder builder)
{
	LOGGER.assertTrue(builder.getTokenType() == JSTokenTypes.LBRACE);
	final PsiBuilder.Marker expr = builder.mark();
	builder.advanceLexer();

	IElementType elementType = builder.getTokenType();

	while(elementType != JSTokenTypes.RBRACE && elementType != null)
	{
		parseProperty(builder);

		elementType = builder.getTokenType();
		if(elementType == JSTokenTypes.RBRACE)
		{
			break;
		}
		else if(elementType == JSTokenTypes.COMMA)
		{
			builder.advanceLexer();
		}
		else
		{
			builder.error(JavaScriptBundle.message("javascript.parser.message.expected.comma"));
		}

		elementType = builder.getTokenType();
		if(elementType == JSTokenTypes.RBRACE)
		{
			builder.error(JavaScriptBundle.message("javascript.parser.property.expected"));
		}
		else if(isNotPropertyStart(elementType))
		{
			break;
		}
	}

	Parsing.checkMatches(builder, JSTokenTypes.RBRACE, JavaScriptBundle.message("javascript.parser.message.expected.rbrace"));
	expr.done(JSElementTypes.OBJECT_LITERAL_EXPRESSION);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:40,代码来源:JsonJavaScriptParser.java

示例12: isAppropriateElementTypeForLiteral

@Override
public boolean isAppropriateElementTypeForLiteral(@NotNull IElementType tokenType)
{
	return JavaScriptTokenSets.COMMENTS.contains(tokenType) ||
			tokenType == JSTokenTypes.WHITE_SPACE ||
			tokenType == JSTokenTypes.SEMICOLON ||
			tokenType == JSTokenTypes.COMMA ||
			tokenType == JSTokenTypes.RPAR ||
			tokenType == JSTokenTypes.RBRACKET ||
			tokenType == JSTokenTypes.RBRACE ||
			tokenType == JSTokenTypes.SINGLE_QUOTE_STRING_LITERAL ||
			tokenType == JSTokenTypes.STRING_LITERAL;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:13,代码来源:JavaScriptQuoteHandler.java

示例13: visitObjectLiteralExpression

@Override
public void visitObjectLiteralExpression(final ASTNode node)
{
	if(((type1 == JSTokenTypes.LBRACE && type2 != JSTokenTypes.RBRACE) ||
			type1 == JSTokenTypes.COMMA ||
			(type1 != JSTokenTypes.LBRACE && type2 == JSTokenTypes.RBRACE)) && shouldFormatObjectLiteralExpression())
	{
		myResult = Spacing.createSpacing(0, 0, 1, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_CODE);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:10,代码来源:JSSpacingProcessor.java

示例14: visitArrayLiteralExpression

@Override
public void visitArrayLiteralExpression(final ASTNode node)
{
	if(((type1 == JSTokenTypes.LBRACKET && type2 != JSTokenTypes.RBRACKET) ||
			type1 == JSTokenTypes.COMMA ||
			(type1 != JSTokenTypes.LBRACKET && type2 == JSTokenTypes.RBRACKET)) && shouldFormatArrayLiteralExpression())
	{
		myResult = Spacing.createSpacing(0, 0, 1, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_CODE);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:10,代码来源:JSSpacingProcessor.java

示例15: isPairedBracesAllowedBeforeType

@Override
public boolean isPairedBracesAllowedBeforeType(@NotNull final IElementType lbraceType, @Nullable final IElementType tokenType)
{
	return JSTokenTypes.WHITE_SPACE == tokenType || JSTokenTypes.COMMENTS.contains(tokenType) || tokenType == JSTokenTypes.SEMICOLON || tokenType ==
			JSTokenTypes.COMMA || tokenType == JSTokenTypes.RPAR || tokenType == JSTokenTypes.RBRACKET || tokenType == JSTokenTypes.RBRACE || null ==
			tokenType;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:7,代码来源:JSBraceMatcher.java


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