Class: Kumi::Core::Analyzer::Passes::SemanticConstraintValidatorPass

Inherits:
VisitorPass show all
Defined in:
lib/kumi/core/analyzer/passes/semantic_constraint_validator_pass.rb

Constant Summary

Constants inherited from PassBase

PassBase::HALT

Instance Method Summary collapse

Methods inherited from VisitorPass

#visit

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



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/kumi/core/analyzer/passes/semantic_constraint_validator_pass.rb', line 11

def run(errors)
  @registry = state[:registry]
  # Visit value and trait declarations
  each_decl do |decl|
    visit(decl) { |node| validate_semantic_constraints(node, decl, errors) }
  end

  # Visit input declarations
  schema.inputs.each do |input_decl|
    visit(input_decl) { |node| validate_semantic_constraints(node, input_decl, errors) }
  end
  state
end