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

Escape stubgen names #406

Merged
merged 18 commits into from
Jul 27, 2023
Merged

Escape stubgen names #406

merged 18 commits into from
Jul 27, 2023

Conversation

u9g
Copy link
Contributor

@u9g u9g commented Jul 25, 2023

Resolves #392.

Copy link
Contributor Author

@u9g u9g left a comment

Choose a reason for hiding this comment

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

Some thoughts

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Nice job! There's a small-but-tricky design question that needs to be resolved first, and otherwise this is good to go.

trustfall_stubgen/src/util.rs Outdated Show resolved Hide resolved
trustfall_stubgen/src/util.rs Outdated Show resolved Hide resolved
trustfall_stubgen/src/util.rs Show resolved Hide resolved
Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Broadly looks good, just a few small things to polish up.

trustfall_stubgen/src/edges_creator.rs Outdated Show resolved Hide resolved
}
}

fn ensure_no_edge_name_keyword_conflicts(
Copy link
Owner

Choose a reason for hiding this comment

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

This function can probably use a better name, more in line with the panic message below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

trustfall_stubgen/src/root.rs Outdated Show resolved Hide resolved
Comment on lines 3 to 9
pub enum Vertex {
Type(()),
Type2(()),
unsafe2(()),

use_(()),

use2(()),
}
Copy link
Owner

Choose a reason for hiding this comment

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

This will cause a lint by default because variant names should be capitalized. Let's capitalize them.

Also, probably add another test that has both upper and lower case of the same keyword at the same time, to make sure we generate a good error there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

trustfall_stubgen/src/util.rs Outdated Show resolved Hide resolved
@obi1kenobi obi1kenobi enabled auto-merge (squash) July 27, 2023 19:02
@obi1kenobi obi1kenobi merged commit 9f1f8cd into obi1kenobi:main Jul 27, 2023
13 checks passed
@u9g u9g deleted the escape-stubgen-names branch July 27, 2023 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.

Not valid rust error from stubgen
2 participants