Files
carbon-lang/toolchain/check/handle_noop.cpp
T
josh11bandChandler Carruth 48c986f52d 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>
2023-12-29 01:28:09 +00:00

38 lines
1.2 KiB
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "toolchain/check/context.h"
namespace Carbon::Check {
auto HandleEmptyDecl(Context& /*context*/, Parse::EmptyDeclId /*parse_node*/)
-> bool {
// Empty declarations have no actions associated.
return true;
}
auto HandleInvalidParse(Context& context, Parse::InvalidParseId parse_node)
-> bool {
return context.TODO(parse_node, "HandleInvalidParse");
}
auto HandleInvalidParseStart(Context& context,
Parse::InvalidParseStartId parse_node) -> bool {
return context.TODO(parse_node, "HandleInvalidParseStart");
}
auto HandleInvalidParseSubtree(Context& context,
Parse::InvalidParseSubtreeId parse_node)
-> bool {
return context.TODO(parse_node, "HandleInvalidParseSubtree");
}
auto HandlePlaceholder(Context& /*context*/,
Parse::PlaceholderId /*parse_node*/) -> bool {
CARBON_FATAL()
<< "Placeholder node should always be replaced before parse completes";
}
} // namespace Carbon::Check