8
9
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
|
# File 'lib/zapata/printer.rb', line 8
def print(raw, args: false)
type = raw.type
result = case type
when :const, :send, :int, :const_send, :literal, :float
raw.value
when :str
str(raw)
when :sym
sym(raw)
when :true
true
when :false
false
when :array
array(raw.value)
when :hash
hash(raw.value)
when :nil
'nil'
when :missing
missing(raw)
when :ivar
ivar(raw)
else
raise "Not yet implemented #{raw}"
end
args ? argize(result, type) : result
end
|