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


Java JSTokenTypes.WHITE_SPACE属性代码示例

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


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

示例1: getInitialValueString

@Override
public String getInitialValueString()
{
	final JSNamespaceDeclarationStub stub = getStub();
	if(stub != null)
	{
		return stub.getInitialValueString();
	}
	final ASTNode anchor = getNode().findChildByType(JSTokenTypes.EQ);

	if(anchor != null)
	{
		ASTNode node = anchor.getTreeNext();

		if(node != null && node.getElementType() == JSTokenTypes.WHITE_SPACE)
		{
			node = node.getTreeNext();
		}

		if(node != null && JavaScriptTokenSets.STRING_LITERALS.contains(node.getElementType()))
		{
			return node.getText();
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:26,代码来源:JSNamespaceDeclarationImpl.java

示例2: hasSemanticLineBeforeNextToken

protected boolean hasSemanticLineBeforeNextToken(final PsiBuilder builder)
{
	IElementType tokenType = builder.getTokenType();
	// force end
	if(tokenType == JSTokenTypes.RBRACE)
	{
		return true;
	}

	int step = 1;
	IElementType rawElementType;
	while((rawElementType = builder.rawLookup(step)) != null)
	{
		if(rawElementType == JSTokenTypes.WHITE_SPACE)
		{
			int tokenStart = builder.rawTokenTypeStart(step);
			CharSequence originalText = builder.getOriginalText();
			for(int i = tokenStart; i < originalText.length(); i++)
			{
				char c = originalText.charAt(i);
				if(c == '\n')
				{
					return true;
				}
				else if(!Character.isWhitespace(c))
				{
					return false;
				}
			}
		}
		else
		{
			break;
		}
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:37,代码来源:StatementParsing.java

示例3: isConst

@Override
public boolean isConst()
{
	final T stub = getStub();
	if(stub != null)
	{
		return stub.isConst();
	}
	final ASTNode parent = getNode().getTreeParent();

	if(parent.getElementType() == JSElementTypes.VAR_STATEMENT)
	{
		ASTNode node = parent.getFirstChildNode();
		IElementType type = node.getElementType();

		if(type == JSElementTypes.ATTRIBUTE_LIST || type == JSElementTypes.REFERENCE_EXPRESSION)
		{
			node = node.getTreeNext();

			if(node != null && node.getElementType() == JSTokenTypes.WHITE_SPACE)
			{
				node = node.getTreeNext();
			}
		}
		return node != null && node.getElementType() == JSTokenTypes.CONST_KEYWORD;
	}

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

示例4: advance

private static ASTNode advance(ASTNode astNode)
{
	astNode = astNode != null ? astNode.getTreeNext() : null;

	if(astNode != null && astNode.getElementType() == JSTokenTypes.WHITE_SPACE)
	{
		astNode = astNode.getTreeNext();
	}
	return astNode;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:10,代码来源:JSFunctionBaseImpl.java

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

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

示例7: removeRangeWithRemovalOfCommas

static void removeRangeWithRemovalOfCommas(final ASTNode myNode, final ASTNode parent)
{
	ASTNode from = myNode, to = myNode.getTreeNext();
	boolean seenComma = false;

	if(to != null && to.getElementType() == JSTokenTypes.WHITE_SPACE)
	{
		to = to.getTreeNext();
	}

	if(to != null && to.getElementType() == JSTokenTypes.COMMA)
	{
		to = to.getTreeNext();
		seenComma = true;

		if(to != null && to.getElementType() == JSTokenTypes.WHITE_SPACE)
		{
			to = to.getTreeNext();
		}
	}

	if(!seenComma)
	{
		ASTNode treePrev = from.getTreePrev();

		if(treePrev != null && treePrev.getElementType() == JSTokenTypes.WHITE_SPACE)
		{
			treePrev = treePrev.getTreePrev();
		}
		if(treePrev != null && treePrev.getElementType() == JSTokenTypes.COMMA)
		{
			from = treePrev;
		}

		if(to != null && to.getElementType() == JSTokenTypes.WHITE_SPACE)
		{
			to = to.getTreeNext();
		}
	}
	parent.removeRange(from, to);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:41,代码来源:JSChangeUtil.java


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