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

reserved keywords must be unquoted #2231

Merged
merged 17 commits into from
Nov 24, 2024

Conversation

alixander
Copy link
Collaborator

@alixander alixander commented Nov 24, 2024

closes #477

This is a big refactor that preserves the original form of the user input into the compiler step (instead of using the formatted version). This allows multiple places in the compilation to check that the user input was unquoted, and if so, don't count it as reserved (among other things, like underscores).

I'm sure I missed some spot where quoting/unquoting is going to result in weirdness -- there's not enough comprehensive tests that exercise quotation to have confidence. But that's okay, this is kind of edge case in that it's mostly useful SQL table and Class shapes. In those instances, the key itself is output to the render, and label is something else. In all other cases, you'd probably just relabel the key instead of using quotes everywhere to try to use a reserved keyword.

@alixander alixander force-pushed the reserve-unquoted-string branch from 35a4c4a to 1ecadc5 Compare November 24, 2024 19:04
@alixander alixander merged commit db687ab into terrastruct:master Nov 24, 2024
3 checks passed
@alixander alixander deleted the reserve-unquoted-string branch November 24, 2024 19:11
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.

compiler: escape reserved keywords
1 participant