Skip to content

parser: introduce more types for Expr variants#498

Merged
Kijewski merged 4 commits intoaskama-rs:masterfrom
Kijewski:pr-expr-box
Jun 24, 2025
Merged

parser: introduce more types for Expr variants#498
Kijewski merged 4 commits intoaskama-rs:masterfrom
Kijewski:pr-expr-box

Conversation

@Kijewski
Copy link
Copy Markdown
Member

This makes the code prettier and Expr smaller.

@Kijewski Kijewski added the parser Related to the parser label Jun 23, 2025
@Kijewski Kijewski force-pushed the pr-expr-box branch 2 times, most recently from 566d9e7 to 82578fb Compare June 23, 2025 20:12
Comment thread askama_parser/src/expr.rs
Option<Box<WithSpan<'a, Expr<'a>>>>,
),
BinOp(Box<BinOp<'a>>),
Range(Box<Range<'a>>),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a const assert on Expr's size to keep an eye on how it goes if you want?

@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

It's a good idea, thanks! Feel free to merge with or without the const assert (I can add it in a follow-up PR 😉).

@Kijewski Kijewski merged commit 338369a into askama-rs:master Jun 24, 2025
42 checks passed
@Kijewski Kijewski deleted the pr-expr-box branch June 24, 2025 10:22
@Kijewski
Copy link
Copy Markdown
Member Author

Yes, good idea. At least it should not get bigger than it is now, I guess. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parser Related to the parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants