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

Update Ast::Constant to use an Ast::Variable for its name #594

Merged
merged 2 commits into from
May 9, 2023

Conversation

jansul
Copy link
Contributor

@jansul jansul commented May 5, 2023

This PR updates Ast::Constant to use an Ast::Variable for its name, rather than a string. This will be useful for future changes to the language server.

Unfortunately, similar to the recent Ast::TypeId change, it includes a lot of .value's, although there were a couple of places where I didn't seem to need to add it such as in the formatter.

This PR also fixes a bug where some invalid constants were allowed, notably ones that start with a number or underscore. (e.g _CONSTANT, 1CONSTANT)

src/compilers/variable.cr Outdated Show resolved Hide resolved
@Sija Sija added bug Something isn't working refactor labels May 5, 2023
@Sija Sija added this to the 0.18.0 milestone May 5, 2023
src/parsers/variable.cr Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor
Development

Successfully merging this pull request may close these issues.

3 participants