Class: Ibex::Runtime::CST::ParseResult

Inherits:
Object
  • Object
show all
Defined in:
lib/ibex/runtime/cst/parse_result.rb,
sig/ibex/runtime/cst/parse_result.rbs

Overview

Immutable result returned by syntax-aware parser entry points.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, syntax_root:, diagnostics:) ⇒ ParseResult

Returns a new instance of ParseResult.

RBS:

  • (value: untyped, syntax_root: SyntaxNode, diagnostics: Array[untyped]) -> void

Parameters:

  • value: (Object)
  • syntax_root: (SyntaxNode)
  • diagnostics: (Array[untyped])


14
15
16
17
18
19
# File 'lib/ibex/runtime/cst/parse_result.rb', line 14

def initialize(value:, syntax_root:, diagnostics:)
  @value = value
  @syntax_root = syntax_root
  @diagnostics = diagnostics.dup.freeze
  freeze
end

Instance Attribute Details

#diagnosticsArray[untyped] (readonly)

Signature:

  • Array[untyped]

Returns:

  • (Array[untyped])


11
12
13
# File 'lib/ibex/runtime/cst/parse_result.rb', line 11

def diagnostics
  @diagnostics
end

#syntax_rootSyntaxNode (readonly)

Signature:

  • SyntaxNode

Returns:



10
11
12
# File 'lib/ibex/runtime/cst/parse_result.rb', line 10

def syntax_root
  @syntax_root
end

#valueObject (readonly)

Signature:

  • untyped

Returns:

  • (Object)


9
10
11
# File 'lib/ibex/runtime/cst/parse_result.rb', line 9

def value
  @value
end