Correctly handle local variables in extends blocks#670
Merged
GuillaumeGomez merged 2 commits intoaskama-rs:mainfrom Jan 27, 2026
Merged
Correctly handle local variables in extends blocks#670GuillaumeGomez merged 2 commits intoaskama-rs:mainfrom
extends blocks#670GuillaumeGomez merged 2 commits intoaskama-rs:mainfrom
Conversation
GuillaumeGomez
commented
Jan 20, 2026
| } | ||
|
|
||
| #[derive(Default, Clone, Copy, PartialEq)] | ||
| enum RenderFor { |
Collaborator
Author
There was a problem hiding this comment.
Not a big fan of the enum's name nor its variants name. If you have better ideas, I'd gladly take them. Also just realized there is no doc, which is unacceptable. Adding that. :)
476458a to
01ce7e7
Compare
Collaborator
Author
|
27th it is, so merging. Gonna do a release as well. Input is still very welcome if issues are found afterward though. :) |
Member
|
Turns our that one cannot approve a PR after it was already merged. :D The change looks good, approved, thanks! 👍 |
Collaborator
Author
|
Thanks for the check! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #667.
Except for the
blockblocks, if there is anextends, we don't render anything else. However, we're still supposed to generate variables and function calls and so on. This PR fixes it by first generating the template in "extends mode", so we generate variables, make the function calls and everything. And then, we generate the blocks content.@Kijewski I'd really like to get your input on this PR to ensure I didn't miss something. However please don't push yourself: if you don't have time or/and motivation or/and energy, I'll simply merge it in a week (so on the 27th) and we can always fix potential new issues later on.
To help you reproduce the original jinja implementation, here's the python script: