本文整理汇总了Java中com.intellij.lang.javascript.JSTokenTypes.CONST_KEYWORD属性的典型用法代码示例。如果您正苦于以下问题:Java JSTokenTypes.CONST_KEYWORD属性的具体用法?Java JSTokenTypes.CONST_KEYWORD怎么用?Java JSTokenTypes.CONST_KEYWORD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.lang.javascript.JSTokenTypes
的用法示例。
在下文中一共展示了JSTokenTypes.CONST_KEYWORD属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: parseSourceElement
@Override
public void parseSourceElement(PsiBuilder builder)
{
final IElementType tokenType = builder.getTokenType();
if(tokenType == JSTokenTypes.FUNCTION_KEYWORD)
{
getFunctionParsing().parseFunctionDeclaration(builder);
}
else if(tokenType == JSTokenTypes.EXPORT_KEYWORD)
{
PsiBuilder.Marker mark = builder.mark();
PsiBuilder.Marker attributeMark = builder.mark();
builder.advanceLexer();
attributeMark.done(JSElementTypes.ATTRIBUTE_LIST);
IElementType nextType = builder.getTokenType();
if(nextType == JSTokenTypes.FUNCTION_KEYWORD)
{
getFunctionParsing().parseFunctionNoMarker(builder, false, mark);
}
else if(nextType == JSTokenTypes.VAR_KEYWORD ||
nextType == JSTokenTypes.CONST_KEYWORD ||
nextType == JSTokenTypes.LET_KEYWORD)
{
parseVarStatementNoMarker(builder, false, mark);
}
else
{
mark.error("Expected function or variable");
}
}
else
{
doParseStatement(builder, true);
}
}