mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 14:54:59 +01:00
This starts adding builtins with TypeType and IntegerLiteralType. Note, structurally that's all they are, and not directly accessible in any way. Adds a type field to SemanticsNode. Now, IntegerLiteralType can be identified as having type=TypeType, and IntegerLiteral as type=IntegerLiteralType. The current iteration doesn't do anything for type propagation, because I wanted to avoid making this too big. This also switches the Identifier IR to instead BindName, with some side-effects. I'd been trying to think how to provide a name for TypeType, and switching around how things worked seemed like a better approach. And while I think it's the right direction (e.g., alias should just be a BindName), I also realized I don't need to name TypeType: there's probably a keyword to refer to the builtin, so it shouldn't use regular name lookup.
29 lines
1.1 KiB
Modula-2
29 lines
1.1 KiB
Modula-2
// 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
|
|
//
|
|
// Note that this is an X-macro header.
|
|
//
|
|
// It does not use `#include` guards, and instead is designed to be `#include`ed
|
|
// after the x-macro is defined in order for its inclusion to expand to the
|
|
// desired output. The x-macro for this header is `CARBON_PARSE_NODE_KIND`. The
|
|
// definition provided will be removed at the end of this file to clean up.
|
|
|
|
#ifndef CARBON_SEMANTICS_NODE_KIND
|
|
#error "Must define the x-macro to use this file."
|
|
#endif
|
|
|
|
CARBON_SEMANTICS_NODE_KIND(Invalid)
|
|
|
|
CARBON_SEMANTICS_NODE_KIND(BinaryOperatorAdd)
|
|
CARBON_SEMANTICS_NODE_KIND(BindName)
|
|
CARBON_SEMANTICS_NODE_KIND(Builtin)
|
|
CARBON_SEMANTICS_NODE_KIND(CodeBlock)
|
|
CARBON_SEMANTICS_NODE_KIND(FunctionDeclaration)
|
|
CARBON_SEMANTICS_NODE_KIND(FunctionDefinition)
|
|
CARBON_SEMANTICS_NODE_KIND(IntegerLiteral)
|
|
CARBON_SEMANTICS_NODE_KIND(Return)
|
|
CARBON_SEMANTICS_NODE_KIND(ReturnExpression)
|
|
|
|
#undef CARBON_SEMANTICS_NODE_KIND
|