Skip to content

Commit

Permalink
[expressionsem.d] generate direct references for `InterpolationHeader…
Browse files Browse the repository at this point in the history
…/Footer`
  • Loading branch information
thewilsonator committed Dec 31, 2024
1 parent 2822bac commit dea60e8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions compiler/src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -4294,9 +4294,9 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
// we need to turn that into:
/+
tuple(
.object.imported!"core.interpolation".InterpolationHeader(),
InterpolationHeader(),
...
.object.imported!"core.interpolation".InterpolationFooter()
InterpolationFooter()
)

There the ... loops through them all, making the even ones
Expand All @@ -4312,12 +4312,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
error(e.loc, "String postfixes on interpolated expression sequences are not allowed.");

Expression makeNonTemplateItem(Identifier which) {
Expression id = new IdentifierExp(e.loc, Id.empty);
id = new DotIdExp(e.loc, id, Id.object);
auto moduleNameArgs = new Objects();
moduleNameArgs.push(new StringExp(e.loc, "core.interpolation"));
id = new DotTemplateInstanceExp(e.loc, id, Id.imported, moduleNameArgs);
id = new DotIdExp(e.loc, id, which);
Expression id = new IdentifierExp(e.loc, which);
id = new CallExp(e.loc, id, new Expressions());
return id;
}
Expand Down

0 comments on commit dea60e8

Please # to comment.