Simple string interpolation.
This allows "%(...)" inside a string literal to interpolate the stringified result of an expression. It doesn't support custom interpolators or format strings, but we can consider extending that later.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class Foo {
|
||||
construct new() {}
|
||||
method(a, b) { "method " + a + " " + b }
|
||||
[a, b] { "subscript " + a + " " + b }
|
||||
method(a, b) { "method %(a) %(b)" }
|
||||
[a, b] { "subscript %(a) %(b)" }
|
||||
}
|
||||
|
||||
var foo = Foo.new()
|
||||
|
||||
Reference in New Issue
Block a user