carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
https://github.com/carbon-language/carbon-lang/blob/trunk/README.md
Other
32.31k stars 1.48k forks source link

Switch decl_state to an arg for modifier functions #4027

Closed jonmeow closed 4 weeks ago

jonmeow commented 4 weeks ago

With private modifiers, we'll want to start checking modifiers later, e.g. after a name conflict is detected (and potentially merged). I think we've agreed to be more explicit about whether the modifier functions are manipulating state, versus trying to keep the state on the stack a little longer (moving Pop to the end of these functions).

Removing FileScope from the stack and renaming it to DeclIntroducerStack to better reflect the usage and behavior. The FileScope mostly reflects an approach that wasn't ultimately adopted.

jonmeow commented 4 weeks ago

I'll do the introducer rename, but I consider DeclIntroducerState as state that's being incrementally built, it's just that it's near-complete when popped.