Class: Kumi::Core::Analyzer::Passes::LIR::ValidationPass

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

Instance Method Summary collapse

Methods inherited from PassBase

#debug, #debug_enabled?, #initialize

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



9
10
11
12
13
14
15
16
17
18
# File 'lib/kumi/core/analyzer/passes/lir/validation_pass.rb', line 9

def run(_errors)
  ops_by_decl = get_state(:lir_module)

  ops_by_decl.each do |decl, payload|
    validate_local_defs!(Array(payload[:operations]), decl)
    validate_single_yield!(Array(payload[:operations]), decl)
  end

  state
end