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

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

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.



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

#diagnosticsObject (readonly)

: Array



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

def diagnostics
  @diagnostics
end

#syntax_rootObject (readonly)

: SyntaxNode



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

def syntax_root
  @syntax_root
end

#valueObject (readonly)

: untyped



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

def value
  @value
end