本文整理汇总了Java中com.intellij.lang.javascript.JSTokenTypes.DEFAULT_KEYWORD属性的典型用法代码示例。如果您正苦于以下问题:Java JSTokenTypes.DEFAULT_KEYWORD属性的具体用法?Java JSTokenTypes.DEFAULT_KEYWORD怎么用?Java JSTokenTypes.DEFAULT_KEYWORD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.lang.javascript.JSTokenTypes
的用法示例。
在下文中一共展示了JSTokenTypes.DEFAULT_KEYWORD属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseCaseOrDefaultClause
private void parseCaseOrDefaultClause(final PsiBuilder builder)
{
final IElementType firstToken = builder.getTokenType();
final PsiBuilder.Marker clause = builder.mark();
if(firstToken != JSTokenTypes.CASE_KEYWORD && firstToken != JSTokenTypes.DEFAULT_KEYWORD)
{
builder.error(JavaScriptBundle.message("javascript.parser.message.expected.catch.or.default"));
}
builder.advanceLexer();
if(firstToken == JSTokenTypes.CASE_KEYWORD)
{
getExpressionParsing().parseExpression(builder);
}
Parsing.checkMatches(builder, JSTokenTypes.COLON, JavaScriptBundle.message("javascript.parser.message.expected.colon"));
while(true)
{
IElementType token = builder.getTokenType();
if(token == null || token == JSTokenTypes.CASE_KEYWORD || token == JSTokenTypes.DEFAULT_KEYWORD || token == JSTokenTypes.RBRACE)
{
break;
}
parseStatement(builder);
}
clause.done(JSElementTypes.CASE_CLAUSE);
}
示例2: parseQualifiedTypeName
public boolean parseQualifiedTypeName(PsiBuilder builder, boolean allowStar)
{
if(!JSTokenTypes.IDENTIFIER_TOKENS_SET.contains(builder.getTokenType()))
{
return false;
}
PsiBuilder.Marker expr = builder.mark();
Parsing.buildTokenElement(JSElementTypes.REFERENCE_EXPRESSION, builder);
while(builder.getTokenType() == JSTokenTypes.DOT)
{
boolean stop = false;
builder.advanceLexer();
final IElementType tokenType = builder.getTokenType();
if(tokenType == JSTokenTypes.ANY_IDENTIFIER && allowStar)
{
builder.advanceLexer();
stop = true;
}
else if(tokenType == JSTokenTypes.DEFAULT_KEYWORD || (tokenType != JSTokenTypes.IDENTIFIER && JSTokenTypes.IDENTIFIER_TOKENS_SET
.contains(tokenType)))
{
builder.advanceLexer(); // TODO: allow any keyword
}
else
{
Parsing.checkMatches(builder, JSTokenTypes.IDENTIFIER, JavaScriptBundle.message("javascript.parser.message.expected.name"));
}
expr.done(JSElementTypes.REFERENCE_EXPRESSION);
expr = expr.precede();
if(stop)
{
break;
}
}
expr.drop();
return true;
}
示例3: parseQualifiedTypeName
@Override
public boolean parseQualifiedTypeName(PsiBuilder builder, boolean allowStar)
{
if(!JSTokenTypes.IDENTIFIER_TOKENS_SET.contains(builder.getTokenType()))
{
return false;
}
PsiBuilder.Marker expr = builder.mark();
buildTokenElement(JSElementTypes.REFERENCE_EXPRESSION, builder);
boolean hasGenerics = false;
while(builder.getTokenType() == JSTokenTypes.DOT)
{
boolean stop = false;
builder.advanceLexer();
final IElementType tokenType = builder.getTokenType();
if(tokenType == JSTokenTypes.ANY_IDENTIFIER && allowStar)
{
builder.advanceLexer();
stop = true;
}
else if(tokenType == JSTokenTypes.LT)
{
parseGenericSignature(builder);
stop = true;
hasGenerics = true;
}
else if(tokenType == JSTokenTypes.DEFAULT_KEYWORD || (tokenType != JSTokenTypes.IDENTIFIER && JSTokenTypes.IDENTIFIER_TOKENS_SET
.contains(tokenType)))
{
builder.advanceLexer(); // TODO: allow any keyword
}
else
{
checkMatches(builder, JSTokenTypes.IDENTIFIER, JavaScriptBundle.message("javascript.parser.message.expected.name"));
}
expr.done(JSElementTypes.REFERENCE_EXPRESSION);
expr = expr.precede();
if(stop)
{
break;
}
}
if(!hasGenerics && builder.getTokenType() == JSTokenTypes.LT)
{
parseGenericSignature(builder);
expr.done(JSElementTypes.REFERENCE_EXPRESSION);
}
else
{
expr.drop();
}
return true;
}