Module: Jade::Frontend::SemanticAnalysis::FunctionCall

Extended by:
FunctionCall, Helper
Included in:
FunctionCall
Defined in:
lib/jade/frontend/semantic_analysis/function_call.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
18
19
20
21
# File 'lib/jade/frontend/semantic_analysis/function_call.rb', line 8

def analyze(node, registry, scope, entry)
  node => AST::FunctionCall(callee:, args:)

  callee_r = analyze_node(callee, registry, scope, entry)
  args_r = analyze_in_parallel(args, registry, scope, entry)

  Result
    .combine(node, scope:, callee: callee_r, args: args_r)
    .add_errors(
      calling_a_constant?(callee_r.node, args_r.node, registry) ?
        [constant_not_callable(callee_r.node, entry)] :
        [],
    )
end