parser: switch to char matcher interface

This commit is contained in:
2023-10-06 15:30:43 -07:00
parent 97283636bc
commit d36310e698
7 changed files with 65 additions and 34 deletions

View File

@ -1,7 +1,7 @@
import gay.pizza.pork.buildext.AstCodegenType
plugins {
id("org.jetbrains.intellij") version "1.15.0"
id("org.jetbrains.intellij") version "1.16.0"
id("gay.pizza.pork.module")
id("gay.pizza.pork.ast")
}

View File

@ -11,9 +11,8 @@ import gay.pizza.pork.idea.psi.gen.PorkElement
class PorkSymbolDeclaration(val element: PorkElement) : PsiSymbolDeclaration {
override fun getDeclaringElement(): PsiElement = element
override fun getRangeInDeclaringElement(): TextRange {
val textRangeOfSymbol = PorkElementHelpers.symbolElementOf(element)?.psi?.textRangeInParent
return PorkElementHelpers.symbolElementOf(element)?.psi?.textRangeInParent
?: throw RuntimeException("Unable to get symbol of element: $element")
return textRangeOfSymbol
}
override fun getSymbol(): Symbol = PorkElementHelpers.psiSymbolFor(element) ?: