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

Document StepStack #4687

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Document StepStack #4687

merged 4 commits into from
Dec 17, 2024

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Dec 16, 2024

Also add underscores to member names, and make PushSpecificId private since it's not used outside PushEntityName

toolchain/sem_ir/stringify_type.cpp Outdated Show resolved Hide resolved
enum Kind : uint8_t {
Inst,
FixedString,
ArrayBound,
Name,
};

// An individual step in the stack.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is all a bit abstract; I think it would help me to have more specifics about what a "step" represents. Maybe something like this?

Suggested change
// An individual step in the stack.
// An individual step in the stack, which prints some component of a type name.

(A more specific name like "PrintStep" might also help, but that may be out of scope here.)

Copy link
Contributor Author

@jonmeow jonmeow Dec 17, 2024

Choose a reason for hiding this comment

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

FWIW in the name direction, I think this is maybe okay right now because the file is just for stringification. But it might be worth it to rename StepStack to be Stringifier, refactoring StringifyTypeExpr to use a member function so that all the push/pop logic would be private. (either way felt out-of-scope)

jonmeow and others added 3 commits December 17, 2024 13:00
@geoffromer geoffromer added this pull request to the merge queue Dec 17, 2024
Merged via the queue into carbon-language:trunk with commit 2eb1c7c Dec 17, 2024
8 checks passed
@jonmeow jonmeow deleted the step-stack branch December 17, 2024 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants