Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // parse.d parseInterpolatedString
- auto exp = new AST.TupleExp(token.loc, parts);
- AST.Expression e = new AST.IdentifierExp(exp.loc, Id.empty);
- e = new AST.DotIdExp(exp.loc, e, Id.object);
- e = new AST.DotIdExp(exp.loc, e, Identifier.idPool("_interpolation"));
- return new AST.CallExp(exp.loc, e, exp);
- // object.d
- struct Interpolation(T...) {
- immutable T args;
- private this()(auto ref T args) { this.args = args; }
- @disable this(this);
- string toString() { return from!q{std.conv}.text(args); }
- alias toString this;
- }
- auto _interpolation(T...)(auto ref T args)
- if (T.length > 0) { return Interpolation!T(args); }
Add Comment
Please, Sign In to add comment