mirror of
				https://github.com/GayPizzaSpecifications/pork.git
				synced 2025-11-04 09:59:39 +00:00 
			
		
		
		
	add debug mode
This commit is contained in:
		@ -5,6 +5,7 @@ import gay.pizza.pork.ast.gen.Node
 | 
			
		||||
import gay.pizza.pork.ast.gen.NodeType
 | 
			
		||||
import gay.pizza.pork.parser.ParseError
 | 
			
		||||
import gay.pizza.pork.parser.ParserNodeAttribution
 | 
			
		||||
import gay.pizza.pork.tokenizer.ExpectedTokenError
 | 
			
		||||
 | 
			
		||||
class PsiBuilderMarkAttribution(val builder: PsiBuilder) : ParserNodeAttribution() {
 | 
			
		||||
  override fun <T : Node> produce(type: NodeType, block: () -> T): T {
 | 
			
		||||
@ -19,6 +20,12 @@ class PsiBuilderMarkAttribution(val builder: PsiBuilder) : ParserNodeAttribution
 | 
			
		||||
        builder.advanceLexer()
 | 
			
		||||
      }
 | 
			
		||||
      throw PorkParser.ExitParser()
 | 
			
		||||
    } catch (e: ExpectedTokenError) {
 | 
			
		||||
      marker.error("${e.message}")
 | 
			
		||||
      while (!builder.eof()) {
 | 
			
		||||
        builder.advanceLexer()
 | 
			
		||||
      }
 | 
			
		||||
      throw PorkParser.ExitParser()
 | 
			
		||||
    } catch (e: ParseError) {
 | 
			
		||||
      marker.error(e.error)
 | 
			
		||||
      while (!builder.eof()) {
 | 
			
		||||
 | 
			
		||||
@ -177,7 +177,8 @@ object PorkReferenceResolution {
 | 
			
		||||
    for (file in getRelevantFiles(containingFile)) {
 | 
			
		||||
      val definitions = PsiTreeUtil.collectElements(file.file) { element ->
 | 
			
		||||
        element is FunctionDefinitionElement ||
 | 
			
		||||
          element is LetDefinitionElement
 | 
			
		||||
          element is LetDefinitionElement ||
 | 
			
		||||
          element is TypeDefinitionElement
 | 
			
		||||
      }.filterIsInstance<PorkNamedElement>()
 | 
			
		||||
      if (name != null) {
 | 
			
		||||
        val fileFoundDefinition = definitions.firstOrNull {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user