本文整理汇总了Java中com.intellij.lang.javascript.JSTokenTypes.FUNCTION_KEYWORD属性的典型用法代码示例。如果您正苦于以下问题:Java JSTokenTypes.FUNCTION_KEYWORD属性的具体用法?Java JSTokenTypes.FUNCTION_KEYWORD怎么用?Java JSTokenTypes.FUNCTION_KEYWORD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.lang.javascript.JSTokenTypes
的用法示例。
在下文中一共展示了JSTokenTypes.FUNCTION_KEYWORD属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseNewExpression
protected boolean parseNewExpression(PsiBuilder builder)
{
ExpressionParsing.LOGGER.assertTrue(builder.getTokenType() == JSTokenTypes.NEW_KEYWORD);
builder.advanceLexer();
if(builder.getTokenType() == JSTokenTypes.FUNCTION_KEYWORD)
{
getFunctionParsing().parseFunctionExpression(builder);
return true;
}
if(!parseMemberExpression(builder, false))
{
builder.error(JavaScriptBundle.message("javascript.parser.message.expected.expression"));
}
return false;
}
示例2: visitFunctionDeclaration
@Override
public void visitFunctionDeclaration(final ASTNode node)
{
if(type1 == JSTokenTypes.FUNCTION_KEYWORD && type2 == JSElementTypes.REFERENCE_EXPRESSION)
{
setSingleSpace(true);
}
else if(type1 == JSElementTypes.REFERENCE_EXPRESSION && type2 == JSElementTypes.PARAMETER_LIST)
{
setSingleSpace(mySettings.SPACE_BEFORE_METHOD_PARENTHESES);
}
else if(type2 == JSElementTypes.BLOCK_STATEMENT)
{
setBraceSpace(mySettings.SPACE_BEFORE_METHOD_LBRACE, mySettings.METHOD_BRACE_STYLE, myChild1.getTextRange());
}
else if(type1 == JSElementTypes.ATTRIBUTE_LIST && type2 == JSTokenTypes.FUNCTION_KEYWORD)
{
setSingleSpace(true);
}
}
示例3: parseSourceElement
@Override
public void parseSourceElement(PsiBuilder builder)
{
final IElementType tokenType = builder.getTokenType();
if(tokenType == JSTokenTypes.FUNCTION_KEYWORD)
{
getFunctionParsing().parseFunctionDeclaration(builder);
}
else if(tokenType == JSTokenTypes.PACKAGE_KEYWORD)
{
parsePackage(builder);
}
else if(tokenType == JSTokenTypes.AT)
{
builder.advanceLexer();
getFunctionParsing().parseAttributeWithoutBrackets(builder);
}
else
{
doParseStatement(builder, true);
}
}
示例4: parseSourceElement
public void parseSourceElement(PsiBuilder builder)
{
final IElementType tokenType = builder.getTokenType();
if(tokenType == JSTokenTypes.FUNCTION_KEYWORD)
{
getFunctionParsing().parseFunctionDeclaration(builder);
}
else
{
parseStatement(builder);
}
}
示例5: addBefore
@Override
public PsiElement addBefore(@NotNull final PsiElement element, final PsiElement anchor) throws IncorrectOperationException
{
if(anchor == getFirstChild() && element instanceof JSAttributeList && anchor.getNode().getElementType() == JSTokenTypes.FUNCTION_KEYWORD)
{
return JSChangeUtil.doDoAddBefore(this, element, anchor);
}
return super.addBefore(element, anchor);
}
示例6: 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);
}
}
示例7: parseFunctionNoMarker
public void parseFunctionNoMarker(final PsiBuilder builder, final boolean expressionContext, final @NotNull PsiBuilder.Marker functionMarker)
{
if(builder.getTokenType() == JSTokenTypes.FUNCTION_KEYWORD)
{ // function keyword may be ommited in context of get/set property definition
builder.advanceLexer();
}
// Function name
final IElementType tokenType = builder.getTokenType();
if(!expressionContext && (tokenType == JSTokenTypes.GET_KEYWORD || tokenType == JSTokenTypes.SET_KEYWORD))
{
builder.advanceLexer();
}
if(isIdentifierName(builder, builder.getTokenType()))
{
getExpressionParsing().parseQualifiedTypeName(builder, false);
}
else
{
if(!expressionContext && builder.getTokenType() != JSTokenTypes.LPAR /*get/set as name*/)
{
builder.error(JavaScriptBundle.message("javascript.parser.message.expected.function.name"));
}
}
parseParameterList(builder);
getExpressionParsing().tryParseType(builder);
if(builder.getTokenType() == JSTokenTypes.SEMICOLON)
{
builder.advanceLexer();
}
else
{
getStatementParsing().parseFunctionBody(builder);
}
functionMarker.done(expressionContext ? JSElementTypes.FUNCTION_EXPRESSION : JSElementTypes.FUNCTION_DECLARATION);
}