first step towards requiring #{ ... } interpolation -- removing naked interps from the compiler.

This commit is contained in:
Jeremy Ashkenas
2010-08-07 08:02:16 -04:00
parent b1f7d5e33b
commit 9df3e6a538
28 changed files with 284 additions and 300 deletions

View File

@@ -4,17 +4,17 @@ name = 'Moe'
ok not not '"Moe"'.match(/^"#{name}"$/i)
ok '"Moe!"'.match(/^"#{name}"$/i) is null
ok not not 'Moe'.match(/^#name$/)
ok 'Moe!'.match(/^#name/)
ok not not 'Moe'.match(/^#{name}$/)
ok 'Moe!'.match(/^#{name}/)
ok 'Moe!'.match(/#{"#{"#{"#name"}"}"}/imgy)
ok 'Moe!'.match(/#{"#{"#{"#{name}"}"}"}/imgy)
ok '$a$b$c'.match(/\$A\$B\$C/i)
a = 1
b = 2
c = 3
ok '123'.match(/#a#b#c/i)
ok '123'.match(/#{a}#{b}#{c}/i)
[a, b, c] = [1, 2, /\d+/]
ok (/#a#b#c$/i).toString() is '/12/\\d+/$/i'
ok (/#{a}#{b}#{c}$/i).toString() is '/12/\\d+/$/i'