Class: Kumi::Core::Analyzer::Passes::InputAccessPlannerPass

Inherits:
PassBase
  • Object
show all
Defined in:
lib/kumi/core/analyzer/passes/input_access_planner_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



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/kumi/core/analyzer/passes/input_access_planner_pass.rb', line 8

def run(_errors)
   = get_state(:input_metadata)

  options = {
    on_missing: :error,
    key_policy: :indifferent
  }

  # TODO : Allow by input definition on policies or at least general policy definition
  # plans = Kumi::Core::Compiler::AccessPlanner.plan(input_metadata, options)

  planner = Kumi::Core::Compiler::AccessPlannerV2.plan(, options, debug_on: debug_enabled?)
  plans = planner.plans
  index_table = planner.index_table

  # Quick validation
  # validate_plans!(plans, errors)

  # Create new state with access plans
  state.with(:input_table, plans.freeze).with(:index_table, index_table.freeze)
end