Skip to content

Correctly escape and reject macro names#460

Merged
Kijewski merged 2 commits intoaskama-rs:masterfrom
Kijewski:pr-macro-identifier
May 23, 2025
Merged

Correctly escape and reject macro names#460
Kijewski merged 2 commits intoaskama-rs:masterfrom
Kijewski:pr-macro-identifier

Conversation

@Kijewski
Copy link
Copy Markdown
Member

@Kijewski Kijewski commented May 23, 2025

Partial fix for #459.

  • crate! etc are invalid macro names
  • Escape macro names like loop!

Right now, true and false are never parsed as identifiers, so a macro true!() cannot be called from inside of a template. Actually, I think that's okay. Just don't call the macro that.

@Kijewski Kijewski force-pushed the pr-macro-identifier branch from 54e312b to 6b05bde Compare May 23, 2025 17:05
@Kijewski Kijewski force-pushed the pr-macro-identifier branch from 6b05bde to 62fbfc7 Compare May 23, 2025 17:07
@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

Nice, thanks!

@Kijewski Kijewski merged commit 429aaf0 into askama-rs:master May 23, 2025
39 checks passed
@Kijewski Kijewski deleted the pr-macro-identifier branch May 23, 2025 19:01
@Kijewski Kijewski mentioned this pull request Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants