Module: Jade::Frontend::SemanticAnalysis::StructDeclaration

Extended by:
Helper, StructDeclaration
Included in:
StructDeclaration
Defined in:
lib/jade/frontend/semantic_analysis/struct_declaration.rb

Instance Method Summary collapse

Methods included from Helper

analyze_duplicate_fields, analyze_in_parallel, analyze_in_sequence, analyze_node, bind, collect_vars, lookup, validate_type_symbol

Instance Method Details

#analyze(node, registry, scope, entry) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/jade/frontend/semantic_analysis/struct_declaration.rb', line 8

def analyze(node, registry, scope, entry)
  node => AST::StructDeclaration(name:)

  symbol_ref = entry.lookup_type(name).to_ref

  Result
    .init(node.with(symbol: symbol_ref), scope)
    .add_errors(validate_no_unbound_vars(symbol_ref, registry, entry))
    .add_errors(validate_type_symbol(symbol_ref, registry, entry))
end