mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 07:47:25 +07:00
14 lines
411 B
Kotlin
14 lines
411 B
Kotlin
import com.intellij.lang.ParserDefinition
|
|
import com.intellij.psi.tree.TokenSet
|
|
import com.example.MyLangTokenTypes
|
|
|
|
class ParserDefinitionWithLegalTokenSetInitializedLazilyInMethod : ParserDefinition {
|
|
private var comments: TokenSet? = null
|
|
override fun getCommentTokens(): TokenSet {
|
|
if (comments == null) {
|
|
comments = TokenSet.create(MyLangTokenTypes.COMMENT)
|
|
}
|
|
return comments!!
|
|
}
|
|
}
|