Skip to content

refactor: Prepare for including a NS with Ident - #1074

Merged
max-sixty merged 7 commits into
semanticfrom
semantic-namespace
Oct 25, 2022
Merged

max-sixty merged 7 commits into
semanticfrom
semantic-namespace

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 24, 2022 •

Copy link
Copy Markdown
Member

This adds an additional Struct while we move over; so we don't need to do one huge PR with the merge conflicts that entails

ref #1031

I'm adding this to the semantic branch to avoid future merge conflicts, even though I'm not a great fan of abandoning main (I also wanted to do something this weekend and wasn't making enough progress with the "onboarding" issues, so chose this)

While they both exist, the only tax is some .into() calls

This adds an additional Struct while we move over; so we don't need to do one huge PR.

ref #1031

I'm adding this to the semantic branch to avoid future merge conflicts, even though I'm not a great fan of abandoning main (I also wanted to do _something_ this weekend and wasn't making enough progress with the "onboarding" issues, so chose this)
@max-sixty
max-sixty requested a review from aljazerzen October 24, 2022 17:22

@aljazerzen aljazerzen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice integration with current ident handling and well prepared for improved ident parsing.

#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
pub struct IdentWithNamespace {
pub namespace: Option<String>,
pub ident: Ident,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we need a better name for this. Ident is the whole node, an identifier, while this field is the specific name in a namespace. I used "variable name" or "var_name", but I'm open to suggestions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes agree. var_name is fine; how about just var?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

var it is

Comment on lines 60 to 61
/// A name. Generally columns, tables, functions, variables.
pub type Ident = String;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe that this can be fully replaced by IdentWithNamespace. Because all idents can have namespace, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, my plan was to move it incrementally; then probably rename IdentWithNamespace back to Ident. I wanted to do the closest thing first, so we didn't get conflicts etc. (But maybe it's not that hard and we could do it in one fell swoop...)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's my philosophy on semantic branch - just do it in one fell swoop :D

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ha! We are so aligned on so many dimensions; "average PR size" is the outlier!

@max-sixty

Copy link
Copy Markdown
Member Author

Merging to ensure we don't get more conflicts — will continue iterating on it!

@max-sixty
max-sixty merged commit d483fa8 into semantic Oct 25, 2022
@max-sixty
max-sixty deleted the semantic-namespace branch October 25, 2022 00:05
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