|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Node representing a top-level function declaration. More...
#include <Compiler_AST.H>
Public Member Functions | |
| Compiler_Function_Decl (const Source_Span &kw={}, std::string value="", const Source_Span &name_sp={}, const Source_Span &arrow_sp={}, Compiler_Type_Expr *result_annot=nullptr, Compiler_Block_Stmt *block=nullptr) noexcept | |
| Constructs a function declaration. | |
Public Member Functions inherited from Aleph::Compiler_Ast_Node | |
| Compiler_Ast_Node (const Source_Span &sp={}) noexcept | |
| Constructs a node with an optional span. | |
| virtual | ~Compiler_Ast_Node () noexcept=default |
| Virtual destructor to ensure proper cleanup of derived nodes. | |
Public Attributes | |
| Source_Span | keyword_span |
Location of the fn keyword. | |
| std::string | name |
| Function name. | |
| Source_Span | name_span |
| Location of the function name token. | |
| DynArray< Compiler_Param > | parameters |
| Ordered list of parameters. | |
| Source_Span | arrow_span |
Location of the optional -> before the result annotation. | |
| Compiler_Type_Expr * | return_annotation = nullptr |
| Optional declared return type. | |
| Compiler_Block_Stmt * | body = nullptr |
| Scoped body of the function. | |
Public Attributes inherited from Aleph::Compiler_Ast_Node | |
| Source_Span | span |
| Source region covered by this node. | |
Node representing a top-level function declaration.
Example: fn add(a, b) { return a + b; }.
Definition at line 1056 of file Compiler_AST.H.
|
inlinenoexcept |
Constructs a function declaration.
Definition at line 1067 of file Compiler_AST.H.
| Source_Span Aleph::Compiler_Function_Decl::arrow_span |
Location of the optional -> before the result annotation.
Definition at line 1062 of file Compiler_AST.H.
| Compiler_Block_Stmt* Aleph::Compiler_Function_Decl::body = nullptr |
Scoped body of the function.
Definition at line 1064 of file Compiler_AST.H.
Referenced by Aleph::Compiler_Typed_Semantic_Analyzer::analyze_function(), and Aleph::Compiler_HIR_Lowering::lower_function().
| Source_Span Aleph::Compiler_Function_Decl::keyword_span |
Location of the fn keyword.
Definition at line 1058 of file Compiler_AST.H.
| std::string Aleph::Compiler_Function_Decl::name |
Function name.
Definition at line 1059 of file Compiler_AST.H.
Referenced by Aleph::Compiler_HIR_Lowering::lower_function(), and Aleph::Compiler_Typed_Semantic_Analyzer::predeclare_function().
| Source_Span Aleph::Compiler_Function_Decl::name_span |
Location of the function name token.
Definition at line 1060 of file Compiler_AST.H.
Referenced by Aleph::Compiler_Typed_Semantic_Analyzer::analyze_function(), and Aleph::Compiler_HIR_Lowering::lower_function().
| DynArray<Compiler_Param> Aleph::Compiler_Function_Decl::parameters |
Ordered list of parameters.
Definition at line 1061 of file Compiler_AST.H.
Referenced by Aleph::Compiler_Typed_Semantic_Analyzer::analyze_function(), Aleph::Compiler_HIR_Lowering::lower_function(), Aleph::Compiler_Typed_Semantic_Analyzer::predeclare_function(), and TEST().
| Compiler_Type_Expr* Aleph::Compiler_Function_Decl::return_annotation = nullptr |
Optional declared return type.
Definition at line 1063 of file Compiler_AST.H.
Referenced by Aleph::Compiler_Typed_Semantic_Analyzer::predeclare_function().