You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{for $name in $names}
{call .helloName}
{param name: $name /}
{/call}
{if not isLast($name)}
<br> // break after every line except the last
{/if}
{/for}
Swift code generation was derived from the Python compiler that enforces inlining output appends. First this looks pretty awful, second it's probably inefficient.
Let's rewrite the compiler to generate a more readable code like
output.append(helloName(["name": nameData30], ijData).description)
if nameIndex30 != nameList30.endIndex {
output.append("<br>")}
The text was updated successfully, but these errors were encountered:
The addition of @State and default parameters has stretched TemplateVariableManager past its breaking point. It currently has 3 responsibilities
1. creating field definitions
2. managing local variable lifetimes
3. generating save/restore logic
The issue is that #1 is for the whole class, #2 is for a single method and #3 is for the render() method.
This conflation was fine when the render() method was the only method with any non-trivial logic, but now that we have default parameters and @State initializers we have a desire to generate code for arbitrary soy expressions in the constructor or static initializers. Right now this is just corrupting some debugging metadata, but future changes will cause more issues.
This requires us to break up these responsibilities. This is step 1. next will be to extract a mechanism to create temporary variables that is detatched from save/restore state solution.
GITHUB_BREAKING_CHANGES=none
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249533688
…is involves
1. making more comments LineCommentLeaf nodes
2. removing inlining of attribute values if the value contains comments (or is force)
3. creating leaves instead of finding the nearest appending point if the first or last element is a LineCommentLeaf.
The optimization in #3 was nice, but it made the formatting idempotent since it changes the AST in a way that it would format differently a second time around.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=301222043
The following template code
compiles to
Swift code generation was derived from the Python compiler that enforces inlining output appends. First this looks pretty awful, second it's probably inefficient.
Let's rewrite the compiler to generate a more readable code like
The text was updated successfully, but these errors were encountered: