Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed so uppercase variables passthrough as constants #433

Merged
merged 2 commits into from
Jan 13, 2021
Merged

Changed so uppercase variables passthrough as constants #433

merged 2 commits into from
Jan 13, 2021

Conversation

vallentin
Copy link
Collaborator

Resolves #432

Fixes so that variables including an uppercase letter, doesn't get prefixed self., i.e. {{ FOO }} results in FOO instead of self.FOO.

testing/tests/simple.rs Outdated Show resolved Hide resolved
@vallentin
Copy link
Collaborator Author

This indirectly also fixes so that {{ None }} results in None instead of self.None (that's why I only check for a single uppercase char).

However, {{ Some("foo") }} is also interpreted as a variable it seems. It at least incorrectly generates (self.Some)("foo"). I'll fix that in a future PR.

@vallentin vallentin changed the title Changed to uppercase variables passthrough as constants Changed so uppercase variables passthrough as constants Jan 11, 2021
askama_shared/src/generator.rs Show resolved Hide resolved
testing/tests/simple.rs Outdated Show resolved Hide resolved
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