mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 02:20:29 +00:00
Add a macro for introducer tokens. (#4031)
Playing with the macro suggestion on #4028, replace DeclKind with some templating that asserts the in-use token is an introducer token. This allows type-safe usage of Lex::TokenKind, reducing the benefit of a separate enum while improving stdout (since now this will ostream as the keyword name).
This commit is contained in:
1 parent
7792e5fce3
commit
d1862e829b
16 files changed
+92
-113
No files matched your search
@@ -77,7 +77,7 @@ auto HandleForHeaderStart(Context& context, Parse::ForHeaderStartId node_id)
|
||||
}
|
||||
|
||||
auto HandleForIn(Context& context, Parse::ForInId node_id) -> bool {
|
||||
context.decl_introducer_state_stack().Pop(DeclIntroducerState::Var);
|
||||
context.decl_introducer_state_stack().Pop<Lex::TokenKind::Var>();
|
||||
return context.TODO(node_id, "HandleForIn");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user