This repository was archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall_nodes.rb
More file actions
207 lines (165 loc) · 2.91 KB
/
all_nodes.rb
File metadata and controls
207 lines (165 loc) · 2.91 KB
1
2
3
4
5
6
7
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
class A::B < ::C
alias foo bar
undef foo
def m(a, (foo), b = foo, *c, d:, e: foo, **f, &g)
__FILE__
__LINE__
__ENCODING__
true
false
nil
-1
-1.0
-1r
-1i
a = 1
a
@foo
@foo = 1
@@foo
@@foo = 1
$foo
$foo = 1
$1
$`
a &&= b
a & b
a and b
a ||= b
a || b
a or b
case foo
in [1, [2], 3,] then true
in Foo
true
in Foo[1, 2, 3]
true
in { foo: bar }
true
in ^foo
true
in foo => bar then true
in [*, foo, *] then
nil
in foo if bar
nil
in foo unless bar
nil
in foo | bar then
nil
in **nil then
nil
in *foo then
nil
else
nil
end
case foo
in bar
nil
else
# empty else
end
:foo
:"foo #{bar}"
"foo"
"foo #{bar}"
`foo`
<<-HERE
HERE
<<-`HERE`
HERE
for a in [1, 2, 3] do
"test"
end
proc { |;foo| foo }
proc { |procarg| body }
proc { |(procarg)| body }
foo.bar(1, *baz, **baz, &baz)
foo.bar = 42
foo&.bar()
foo&.bar = 42
(foo..bar)
(foo..)
(..bar)
(foo...bar)
(foo...)
(...bar)
foo do
break 42
return 42
yield(42)
next 42
redo
retry
super(foo)
super
end
case foo
when bar then nil
else
nil
end
defined?(foo)
if foo..bar; end
if foo...bar; end
begin
foo
rescue E => e
bar
else
baz
ensure
foo
end
{ 'foo': bar, :baz => foo }
if foo then bar else baz; end
foo if bar
foo unless bar
foo ? bar : baz
foo in bar
foo[1, 2]
foo[1, 2] = 3
begin
end
->() {}
(a, b) = [c, d]
if /foo/
end
/(?<match>bar)/ =~ 'bar'
foo { _1 }
foo += bar
/foo/mix
until foo do
bar
end
begin
foo
end until bar
while foo do
bar
end
begin
foo
end while bar
end
def self.foo
end
def m() = 42
def self.m() = 42
module M
class << self
foo
end
end
::A = 1
::A::B = 1
A = 1
def foo(...)
bar(...)
end
def foo(**nil)
end
end
BEGIN { foo }
END { foo }