10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/code/object/identifier_list.rb', line 10
def call(**args)
operator = args.fetch(:operator, nil)
arguments = args.fetch(:arguments, [])
context = args.fetch(:context)
value = arguments.first&.value
case operator.to_s
when /=$/
sig(args) { Object }
context = context.lookup!(raw.first)
context =
raw[..-2].reduce(context) do |context, identifier|
context.code_fetch(identifier)
end
context.code_set(
raw.last,
if operator == "="
value
else
context.fetch(raw.last).call(
**args,
operator: operator[..-2],
arguments: [Argument.new(value)]
)
end
)
context.code_fetch(raw.last)
else
super
end
end
|