diff --git a/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRLexer.kt b/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRLexer.kt index ce531e6..415d997 100644 --- a/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRLexer.kt +++ b/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRLexer.kt @@ -140,6 +140,18 @@ class MLIRLexer : LexerBase() { currentOffset++ tokenType = MLIRTokenTypes.OPERATOR } + char == '.' -> { + currentOffset++ + tokenType = when { + currentOffset < endOffset - 1 && buffer[currentOffset] == char && buffer[currentOffset + 1] == char -> { + currentOffset += 2 + MLIRTokenTypes.ELLIPSIS + } + else -> { + TokenType.BAD_CHARACTER + } + } + } else -> { currentOffset++ tokenType = TokenType.BAD_CHARACTER diff --git a/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRTokenTypes.kt b/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRTokenTypes.kt index 33d2efd..2d17b9b 100644 --- a/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRTokenTypes.kt +++ b/src/main/kotlin/org/komlir/intellijmlirplugin/MLIRTokenTypes.kt @@ -22,6 +22,7 @@ object MLIRTokenTypes { @JvmField val RBRACKET = IElementType("MLIR_RBRACKET", MLIRLanguage) @JvmField val LT = IElementType("MLIR_LT", MLIRLanguage) @JvmField val GT = IElementType("MLIR_GT", MLIRLanguage) + @JvmField val ELLIPSIS = IElementType("MLIR_ELLIPSIS", MLIRLanguage) object TokenSets { @JvmField val identifiers = TokenSet.create(IDENTIFIER, SSA_VALUE, SYMBOL_REF, OPERATION)