Start adding var decls to semantics. (#2447)

This is just the declaration, without initialization. Partly breaking it out because I'm changing the placeholder builtin types.

Might also need to separate out storage of the var from the name bind.
This commit is contained in:
Jon Ross-Perkins
2022-12-07 15:10:42 -08:00
committed by GitHub
parent 04f0288cd2
commit 30960d11a9
7 changed files with 130 additions and 17 deletions
+2 -2
View File
@@ -148,7 +148,7 @@ class SemanticsNode {
-> SemanticsNode {
return SemanticsNode(parse_node, SemanticsNodeKind::IntegerLiteral(),
SemanticsNodeId::MakeBuiltinReference(
SemanticsBuiltinKind::IntegerLiteralType()),
SemanticsBuiltinKind::IntegerType()),
integer.index);
}
auto GetAsIntegerLiteral() const -> SemanticsIntegerLiteralId {
@@ -159,7 +159,7 @@ class SemanticsNode {
static auto MakeRealLiteral(ParseTree::Node parse_node) -> SemanticsNode {
return SemanticsNode(parse_node, SemanticsNodeKind::RealLiteral(),
SemanticsNodeId::MakeBuiltinReference(
SemanticsBuiltinKind::RealLiteralType()));
SemanticsBuiltinKind::RealType()));
}
auto GetAsRealLiteral() const -> NoArgs {
CARBON_CHECK(kind_ == SemanticsNodeKind::RealLiteral());