mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 09:11:05 +01:00
As I'm looking at adding builtins, it feels a bit like the types of args will end up scaling close to the number of semantic kinds. Rather than having this lead to a bunch of macros, this approach drops the macros for plain code. Note, this adds Get functions too -- I'd planned those regardless for type safety, this is just getting ahead of the issue so that the Print function is pretty clean.
28 lines
1.0 KiB
Modula-2
28 lines
1.0 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(CodeBlock)
|
|
CARBON_SEMANTICS_NODE_KIND(FunctionDeclaration)
|
|
CARBON_SEMANTICS_NODE_KIND(FunctionDefinition)
|
|
CARBON_SEMANTICS_NODE_KIND(Identifier)
|
|
CARBON_SEMANTICS_NODE_KIND(IntegerLiteral)
|
|
CARBON_SEMANTICS_NODE_KIND(Return)
|
|
CARBON_SEMANTICS_NODE_KIND(ReturnExpression)
|
|
|
|
#undef CARBON_SEMANTICS_NODE_KIND
|