Add framework for the extern keyword. (#3755)

This doesn't add full support. I'm separating it out to make the effects
of the modifier changes clearer for review. I'm restructuring a little
with the expectation that we'll have some more categories of modifier
keywords in the future (similar to `extern`, these may not be in a "set"
such as access), and thus easily scaling up to a few more would be
useful.
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2024-03-08 16:01:12 +00:00
1 parent 56d70dc3a2
commit 096daecc57
21 files changed
+241 -102

No files matched your search

+2 -1
View File
@@ -209,7 +209,8 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId parse_node)
// For an `extend impl` declaration, mark the impl as extending this `impl`.
if (!!(context.decl_state_stack().innermost().modifier_set &
KeywordModifierSet::Extend)) {
auto extend_node = context.decl_state_stack().innermost().saw_decl_modifier;
auto extend_node = context.decl_state_stack().innermost().modifier_node_id(
ModifierOrder::Decl);
ExtendImpl(context, extend_node, parse_node, self_type_node, self_type_id,
params_node, constraint_type_id);
}