Skip to content

Basic canonicalize_expr of idents with tests #7806

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gamebox
Copy link
Collaborator

@gamebox gamebox commented May 23, 2025

This is just me getting this started and sharing things so that I can make sure I understand what we are trying to accomplish correct.

@gamebox gamebox requested review from smores56 and lukewilliamboswell and removed request for lukewilliamboswell May 23, 2025 17:50
Copy link
Collaborator

@lukewilliamboswell lukewilliamboswell left a comment

Choose a reason for hiding this comment

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

These changes look good. My only question is around how we will do snapshots for Can, but I'm sure we will get to that soon.

if (parse_ir.tokens.resolveIdentifier(e.token)) |ident| {
switch (scope.levels.lookup(.ident, ident)) {
.InScope => {
return ir.exprs.append(ir.env.gpa, .{ .@"var" = .{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this was the original intention, but I assumed "var" was referring to the new var keyword for reassignable defs.

Personally I like the name lookup for this because it's an expression that's looking up something by name.

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.

3 participants