We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7b4b54 commit 35d93b0Copy full SHA for 35d93b0
transform.rb
@@ -210,7 +210,24 @@ def rewrite_let_env(exp)
210
end
211
212
213
+ def create_concat(sub)
214
+ right = sub.pop
215
+ right = E[:callm,right,:to_s] if !right.is_a?(Array)
216
+ return right if sub.size == 0
217
+ E[:callm, create_concat(sub), :concat, [right]]
218
+ end
219
+
220
+ def rewrite_concat(exp)
221
+ exp.depth_first do |e|
222
+ if e[0] == :concat
223
+ e.replace(create_concat(e[1..-1]))
224
225
+ :next
226
227
228
229
def preprocess exp
230
+ rewrite_concat(exp)
231
rewrite_strconst(exp)
232
rewrite_fixnumconst(exp)
233
rewrite_operators(exp)
0 commit comments