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


Java JSTokenTypes.LBRACKET属性代码示例

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


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

示例1: getQualifier

@Override
public JSExpression getQualifier()
{
	ASTNode child = getNode().getFirstChildNode();
	while(child != null)
	{
		final IElementType type = child.getElementType();
		if(type == JSTokenTypes.LBRACKET)
		{
			return null;
		}
		if(JSElementTypes.EXPRESSIONS.contains(type))
		{
			return (JSExpression) child.getPsi();
		}
		child = child.getTreeNext();
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:19,代码来源:JSIndexedPropertyAccessExpressionImpl.java

示例2: getIndexExpression

@Override
public JSExpression getIndexExpression()
{
	ASTNode child = getNode().getFirstChildNode();
	boolean bracketPassed = false;
	while(child != null)
	{
		final IElementType type = child.getElementType();
		if(type == JSTokenTypes.LBRACKET)
		{
			bracketPassed = true;
		}
		if(bracketPassed && JSElementTypes.EXPRESSIONS.contains(type))
		{
			return (JSExpression) child.getPsi();
		}
		child = child.getTreeNext();
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:20,代码来源:JSIndexedPropertyAccessExpressionImpl.java

示例3: 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

示例4: parseRoot

private void parseRoot(PsiBuilder builder)
{
	if(builder.getTokenType() == JSTokenTypes.LBRACKET)
	{
		parseArrayLiteralExpression(builder);
		if(builder.getTokenType() != null)
		{
			builder.error(JavaScriptBundle.message("javascript.parser.message.expected.eof"));
		}
	}
	else if(builder.getTokenType() == JSTokenTypes.LBRACE)
	{
		parseObjectLiteralExpression(builder);
		if(builder.getTokenType() != null)
		{
			builder.error(JavaScriptBundle.message("javascript.parser.message.expected.eof"));
		}
	}
	else
	{
		builder.error(JavaScriptBundle.message("javascript.parser.message.expected.lbrace.or.lbracket"));
	}

	while(builder.getTokenType() != null)
	{
		builder.advanceLexer();
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:28,代码来源:JsonJavaScriptParser.java

示例5: isNotPropertyStart

@Override
public boolean isNotPropertyStart(PsiBuilder builder, IElementType elementType)
{
	return super.isNotPropertyStart(builder, elementType) && elementType != JSTokenTypes.LBRACKET;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:5,代码来源:EcmaScript6ExpressionParsing.java

示例6: parseProperty

private void parseProperty(final PsiBuilder builder)
{
	if(myPropertyDepth > 1000)
	{
		builder.error("Too big depth for property");
		int braceCount = 0;
		int bracketCount = 0;
		while(!builder.eof())
		{
			IElementType tokenType = builder.getTokenType();
			if(tokenType == JSTokenTypes.LBRACE)
			{
				braceCount++;
			}
			else if(tokenType == JSTokenTypes.LBRACKET)
			{
				bracketCount++;
			}
			else if(tokenType == JSTokenTypes.RBRACE)
			{
				braceCount--;
				if(braceCount < 0)
				{
					break;
				}
			}
			else if(tokenType == JSTokenTypes.RBRACKET)
			{
				bracketCount--;
				if(bracketCount < 0)
				{
					break;
				}
			}
			builder.advanceLexer();
		}

		return;
	}

	final IElementType nameToken = builder.getTokenType();
	final PsiBuilder.Marker property = builder.mark();
	myPropertyDepth++;

	if(isNotPropertyStart(nameToken))
	{
		builder.error(JavaScriptBundle.message("javascript.parser.message.expected.identifier.string.literal.or.numeric.literal"));
	}
	builder.advanceLexer();
	Parsing.checkMatches(builder, JSTokenTypes.COLON, JavaScriptBundle.message("javascript.parser.message.expected.colon"));

	if(!parseValue(builder))
	{
		builder.error(JavaScriptBundle.message("javascript.parser.message.expected.expression"));
	}
	myPropertyDepth--;

	property.done(JSElementTypes.PROPERTY);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:59,代码来源:JsonJavaScriptParser.java

示例7: parseValue

private boolean parseValue(PsiBuilder builder)
{
	final IElementType firstToken = builder.getTokenType();
	if(firstToken == JSTokenTypes.NUMERIC_LITERAL ||
			firstToken == JSTokenTypes.STRING_LITERAL ||
			firstToken == JSTokenTypes.SINGLE_QUOTE_STRING_LITERAL ||
			firstToken == JSTokenTypes.NULL_KEYWORD ||
			firstToken == JSTokenTypes.FALSE_KEYWORD ||
			firstToken == JSTokenTypes.TRUE_KEYWORD)
	{
		String errorMessage = ExpressionParsing.validateLiteral(builder);
		Parsing.buildTokenElement(JSElementTypes.LITERAL_EXPRESSION, builder);
		if(errorMessage != null)
		{
			builder.error(errorMessage);
		}
		return true;
	}
	if(firstToken == JSTokenTypes.LBRACKET)
	{
		parseArrayLiteralExpression(builder);
		return true;
	}
	else if(firstToken == JSTokenTypes.MINUS)
	{
		PsiBuilder.Marker marker = builder.mark();
		builder.advanceLexer();
		if(builder.getTokenType() == JSTokenTypes.NUMERIC_LITERAL)
		{
			builder.advanceLexer();
			marker.done(JSElementTypes.PREFIX_EXPRESSION);
		}
		else
		{
			marker.error("Unexpected token");
		}
		return true;
	}
	else if(firstToken == JSTokenTypes.LBRACE)
	{
		parseObjectLiteralExpression(builder);
		return true;
	}
	else
	{
		return false;
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:48,代码来源:JsonJavaScriptParser.java


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