本文整理汇总了Java中com.intellij.lexer.MergeFunction类的典型用法代码示例。如果您正苦于以下问题:Java MergeFunction类的具体用法?Java MergeFunction怎么用?Java MergeFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MergeFunction类属于com.intellij.lexer包,在下文中一共展示了MergeFunction类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMergeFunction
import com.intellij.lexer.MergeFunction; //导入依赖的package包/类
@Override
public MergeFunction getMergeFunction() {
return ((final IElementType type, final Lexer originalLexer) -> {
if (type == SoyTypes.OTHER || type == TokenType.WHITE_SPACE) {
IElementType returnType = type;
while (originalLexer.getTokenType() == SoyTypes.OTHER
|| originalLexer.getTokenType() == TokenType.WHITE_SPACE) {
if (originalLexer.getTokenType() == SoyTypes.OTHER) {
returnType = SoyTypes.OTHER;
}
originalLexer.advance();
}
return returnType;
}
return type;
});
}
示例2: getMergeFunction
import com.intellij.lexer.MergeFunction; //导入依赖的package包/类
@Override
public MergeFunction getMergeFunction() {
return new MergeFunction() {
@Override
public IElementType merge(IElementType type, Lexer originalLexer) {
if (!allMergables.contains(type)) {
return type;
}
TokenSet merging = tokensToMerge.contains(type) ? tokensToMerge : tokensToMerge2;
while (true) {
final IElementType tokenType = originalLexer.getTokenType();
if (!merging.contains(tokenType)) break;
originalLexer.advance();
}
return merging == tokensToMerge ? LONGSTRING : LONGCOMMENT;
}
};
}
示例3: getMergeFunction
import com.intellij.lexer.MergeFunction; //导入依赖的package包/类
@Override
public MergeFunction getMergeFunction() {
return MERGE_FUNCTION;
}
示例4: getMergeFunction
import com.intellij.lexer.MergeFunction; //导入依赖的package包/类
@Override
public MergeFunction getMergeFunction()
{
return myMergeFunction;
}
示例5: getMergeFunction
import com.intellij.lexer.MergeFunction; //导入依赖的package包/类
@Override
public MergeFunction getMergeFunction()
{
return ourMergeFunction;
}