Class: Kumi::Core::Analyzer::Passes::AttachTerminalInfoPass

Inherits:
PassBase
  • Object
show all
Defined in:
lib/kumi/core/analyzer/passes/attach_terminal_info_pass.rb

Constant Summary collapse

NAST =
Kumi::Core::NAST

Constants inherited from PassBase

PassBase::HALT

Instance Method Summary collapse

Methods inherited from PassBase

contract_declared?, #debug, #debug_enabled?, declared_optional_reads, declared_reads, declared_writes, #initialize, optional_reads, reads, writes

Methods included from ErrorReporting

#inferred_location, #raise_localized_error, #raise_syntax_error, #raise_type_error, #report_enhanced_error, #report_error, #report_semantic_error, #report_syntax_error, #report_type_error

Constructor Details

This class inherits a constructor from Kumi::Core::Analyzer::Passes::PassBase

Instance Method Details

#run(_errors) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/kumi/core/analyzer/passes/attach_terminal_info_pass.rb', line 15

def run(_errors)
  @dbg = ENV["KUMI_DEBUG_TERMINAL"] == "1"
  plans  = get_state(:input_table, required: true) # Array<InputPlan>
  by_fqn = plans.each_with_object({}) { |p, h| h[p.path_fqn.to_s] = p }
  mod    = get_state(:snast_module, required: true)
  annotate!(mod, by_fqn)
  state
end