當前位置: 首頁>>代碼示例>>Java>>正文


Java PsiBuilder.remapCurrentToken方法代碼示例

本文整理匯總了Java中com.intellij.lang.PsiBuilder.remapCurrentToken方法的典型用法代碼示例。如果您正苦於以下問題:Java PsiBuilder.remapCurrentToken方法的具體用法?Java PsiBuilder.remapCurrentToken怎麽用?Java PsiBuilder.remapCurrentToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.lang.PsiBuilder的用法示例。


在下文中一共展示了PsiBuilder.remapCurrentToken方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseGtAutoClose

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
private void parseGtAutoClose(PsiBuilder builder, ParserState parserState) {
    if (parserState.currentScope.tokenType == m_types.TAG_PROPERTY) {
        parserState.currentScope.end();
        parserState.scopes.pop();
        parserState.currentScope = parserState.scopes.empty() ? parserState.fileScope : parserState.scopes.peek();
    }

    if (parserState.currentScope.resolution == startTag || parserState.currentScope.resolution == closeTag) {
        builder.remapCurrentToken(m_types.TAG_GT);
        builder.advanceLexer();
        parserState.dontMove = true;

        parserState.currentScope.end();
        parserState.scopes.pop();

        parserState.currentScope = parserState.scopes.empty() ? parserState.fileScope : parserState.scopes.peek();
    }
}
 
開發者ID:reasonml-editor,項目名稱:reasonml-idea-plugin,代碼行數:19,代碼來源:RmlParser.java

示例2: parseLt

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
private void parseLt(PsiBuilder builder, ParserState parserState) {
    // Can be a symbol or a JSX tag
    IElementType nextTokenType = builder.rawLookup(1);
    if (nextTokenType == m_types.LIDENT || nextTokenType == m_types.UIDENT) {
        // Surely a tag
        builder.remapCurrentToken(m_types.TAG_LT);
        parserState.currentScope = markScope(builder, parserState.scopes, startTag, m_types.TAG_START, groupExpression, m_types.TAG_LT);
        parserState.currentScope.complete = true;

        builder.advanceLexer();
        parserState.dontMove = true;
        builder.remapCurrentToken(m_types.TAG_NAME);
    } else if (nextTokenType == m_types.SLASH) {
        builder.remapCurrentToken(m_types.TAG_LT);
        parserState.currentScope = markScope(builder, parserState.scopes, closeTag, m_types.TAG_CLOSE, any, m_types.TAG_LT);
        parserState.currentScope.complete = true;
    }
}
 
開發者ID:reasonml-editor,項目名稱:reasonml-idea-plugin,代碼行數:19,代碼來源:RmlParser.java

示例3: parseLIdent

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
private void parseLIdent(PsiBuilder builder, ParserState parserState) {
    if (parserState.isCurrentResolution(type)) {
        builder.remapCurrentToken(m_types.TYPE_CONSTR_NAME);
        parserState.currentScope.resolution = typeNamed;
        parserState.currentScope.complete = true;
    } else if (parserState.isCurrentResolution(external)) {
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.currentScope.resolution = externalNamed;
        parserState.currentScope.complete = true;
    } else if (parserState.isCurrentResolution(let)) {
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.dontMove = wrapWith(m_types.VAR_NAME, builder);
        parserState.currentScope.resolution = letNamed;
        parserState.currentScope.complete = true;
    } else if (parserState.isCurrentResolution(val)) {
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.currentScope.resolution = valNamed;
        parserState.currentScope.complete = true;
    } else {
        if (parserState.notCurrentResolution(annotationName)) {
            builder.remapCurrentToken(m_types.VALUE_NAME);
            parserState.dontMove = wrapWith(m_types.VAR_NAME, builder);
        }
    }
}
 
開發者ID:reasonml-editor,項目名稱:reasonml-idea-plugin,代碼行數:26,代碼來源:OclParser.java

示例4: parseUIdent

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
private void parseUIdent(PsiBuilder builder, ParserState parserState) {
    if (parserState.isCurrentResolution(open)) {
        // It is a module name/path
        parserState.currentScope.complete = true;
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.currentScope = markComplete(builder, parserState.scopes, openModulePath, m_types.MODULE_PATH);
        parserState.dontMove = wrapWith(m_types.MODULE_NAME, builder);
    } else if (parserState.isCurrentResolution(include)) {
        // It is a module name/path
        parserState.currentScope.complete = true;
        builder.remapCurrentToken(m_types.MODULE_NAME);
        parserState.currentScope = markComplete(builder, parserState.scopes, openModulePath, m_types.MODULE_PATH);
    } else if (parserState.isCurrentResolution(exception)) {
        parserState.currentScope.complete = true;
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.dontMove = wrapWith(m_types.EXCEPTION_NAME, builder);
        parserState.currentScope.resolution = exceptionNamed;
    } else if (parserState.isCurrentResolution(module)) {
        // Module definition
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.dontMove = wrapWith(m_types.MODULE_NAME, builder);
        parserState.currentScope.resolution = moduleNamed;
    }
}
 
開發者ID:reasonml-editor,項目名稱:reasonml-idea-plugin,代碼行數:25,代碼來源:OclParser.java

示例5: parseLIdent

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
private void parseLIdent(PsiBuilder builder, ParserState parserState) {
    if (parserState.currentScope.resolution == type) {
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.dontMove = wrapWith(m_types.TYPE_CONSTR_NAME, builder);
        parserState.currentScope.resolution = typeNamed;
        parserState.currentScope.complete = true;
    } else if (parserState.currentScope.resolution == external) {
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.currentScope.resolution = externalNamed;
        parserState.currentScope.complete = true;
    } else if (parserState.currentScope.resolution == let) {
        builder.remapCurrentToken(m_types.VALUE_NAME);
        parserState.dontMove = wrapWith(m_types.VAR_NAME, builder);
        parserState.currentScope.resolution = letNamed;
        parserState.currentScope.complete = true;
    } else if (parserState.currentScope.resolution == startTag) {
        // This is a property
        parserState.end();
        builder.remapCurrentToken(m_types.PROPERTY_NAME);
        parserState.currentScope = markScope(builder, parserState.scopes, tagProperty, m_types.TAG_PROPERTY, groupExpression, m_types.LIDENT);
        parserState.currentScope.complete = true;
    } else {
        if (parserState.notCurrentResolution(annotationName)) {
            builder.remapCurrentToken(m_types.VALUE_NAME);
            parserState.dontMove = wrapWith(m_types.VAR_NAME, builder);
        }
    }
}
 
開發者ID:reasonml-editor,項目名稱:reasonml-idea-plugin,代碼行數:29,代碼來源:RmlParser.java


注:本文中的com.intellij.lang.PsiBuilder.remapCurrentToken方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。