Skip to content

Commit

Permalink
Refactor StringifyTypeExpr (carbon-language#4597)
Browse files Browse the repository at this point in the history
* Make the step stack into a class
* Make the operations on the stack (pushing, popping, test for done)
into methods on the stack class.
* Add more kinds of steps (array bound and name).
* Rewrite cases to use the new kinds of steps. Afterward, none use
`Step::Next()` or the step index, so those get removed.
* Add another convenience method `PushTypeId`.
* Remove the `SemIR::File&` member from the steps, since it doesn't
change.

Hopefully using `step_stack.Push`... calls makes it clear that they are
resolved in the reverse order they are executed.

---------

Co-authored-by: Josh L <[email protected]>
  • Loading branch information
josh11b and josh11b authored Nov 27, 2024
1 parent 14bb9dd commit b894d4e
Showing 1 changed file with 148 additions and 130 deletions.
Loading

0 comments on commit b894d4e

Please sign in to comment.