mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Start using typed parse node ids in the check stage (#3547)
Goal is to increase type safety, though more work needs to be done (see added TODOs). Note that, after this change, check handlers corresponding to deleted parse node kinds will no longer compile. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
co-authored by
Chandler Carruth
parent
a602be89e2
commit
48c986f52d
@@ -6,15 +6,18 @@
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
auto HandleCodeBlockStart(Context& context, Parse::NodeId parse_node) -> bool {
|
||||
auto HandleCodeBlockStart(Context& context, Parse::CodeBlockStartId parse_node)
|
||||
-> bool {
|
||||
context.node_stack().Push(parse_node);
|
||||
context.PushScope();
|
||||
return true;
|
||||
}
|
||||
|
||||
auto HandleCodeBlock(Context& context, Parse::NodeId /*parse_node*/) -> bool {
|
||||
auto HandleCodeBlock(Context& context, Parse::CodeBlockId /*parse_node*/)
|
||||
-> bool {
|
||||
context.PopScope();
|
||||
context.node_stack().PopForSoloParseNode<Parse::NodeKind::CodeBlockStart>();
|
||||
context.node_stack()
|
||||
.PopAndDiscardSoloParseNode<Parse::NodeKind::CodeBlockStart>();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user