diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-07-03 10:53:28 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-07-31 10:27:15 +0200 |
commit | 266cefc3212791ad3a60c484ec89ed5b1c22bae6 (patch) | |
tree | d56fd9d576e8d23c7345c67b4865ddcdca252772 /askama_derive/src | |
parent | f9b2259cb7993d9aa0aab5745247c02206c524cf (diff) | |
download | askama-266cefc3212791ad3a60c484ec89ed5b1c22bae6.tar.gz askama-266cefc3212791ad3a60c484ec89ed5b1c22bae6.tar.bz2 askama-266cefc3212791ad3a60c484ec89ed5b1c22bae6.zip |
parser: rename block to nodes
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/generator.rs | 6 | ||||
-rw-r--r-- | askama_derive/src/heritage.rs | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 66f1b1c..5308c02 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -762,7 +762,7 @@ impl<'a> Generator<'a> { buf.writeln(" {")?; - arm_size += self.handle(ctx, &cond.block, buf, AstLevel::Nested)?; + arm_size += self.handle(ctx, &cond.nodes, buf, AstLevel::Nested)?; arm_sizes.push(arm_size); } self.handle_ws(ws); @@ -809,7 +809,7 @@ impl<'a> Generator<'a> { self.visit_target(buf, true, true, &arm.target); buf.writeln(" => {")?; - arm_size = self.handle(ctx, &arm.block, buf, AstLevel::Nested)?; + arm_size = self.handle(ctx, &arm.nodes, buf, AstLevel::Nested)?; } self.handle_ws(ws2); @@ -881,7 +881,7 @@ impl<'a> Generator<'a> { buf.writeln("if !_did_loop {")?; self.locals.push(); - let mut size_hint2 = self.handle(ctx, &loop_block.else_block, buf, AstLevel::Nested)?; + let mut size_hint2 = self.handle(ctx, &loop_block.else_nodes, buf, AstLevel::Nested)?; self.handle_ws(loop_block.ws3); size_hint2 += self.write_buf_writable(buf)?; self.locals.pop(); diff --git a/askama_derive/src/heritage.rs b/askama_derive/src/heritage.rs index 342416e..9ef7aeb 100644 --- a/askama_derive/src/heritage.rs +++ b/askama_derive/src/heritage.rs @@ -84,18 +84,20 @@ impl Context<'_> { } Node::Cond(branches, _) => { for cond in branches { - nested.push(&cond.block); + nested.push(&cond.nodes); } } Node::Loop(Loop { - body, else_block, .. + body, + else_nodes: else_block, + .. }) => { nested.push(body); nested.push(else_block); } Node::Match(_, _, arms, _) => { for arm in arms { - nested.push(&arm.block); + nested.push(&arm.nodes); } } _ => {} |