mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 10:21:04 +01:00
Migrate declaration parsing to value semantics (#614)
* Use Expression by value in FunctionDefinition * Migrate choice declarations to value semantics * Migrate Declaration parsing to value semantics
This commit is contained in:
@@ -13,16 +13,15 @@ namespace Carbon {
|
||||
struct FunctionDefinition {
|
||||
int line_num;
|
||||
std::string name;
|
||||
const Expression* param_pattern;
|
||||
const Expression* return_type;
|
||||
Expression param_pattern;
|
||||
Expression return_type;
|
||||
const Statement* body;
|
||||
};
|
||||
|
||||
auto MakeFunDef(int line_num, std::string name, const Expression* ret_type,
|
||||
const Expression* param, const Statement* body)
|
||||
-> FunctionDefinition*;
|
||||
void PrintFunDef(const FunctionDefinition*);
|
||||
void PrintFunDefDepth(const FunctionDefinition*, int);
|
||||
auto MakeFunDef(int line_num, std::string name, Expression ret_type,
|
||||
Expression param, const Statement* body) -> FunctionDefinition;
|
||||
void PrintFunDef(const FunctionDefinition&);
|
||||
void PrintFunDefDepth(const FunctionDefinition&, int);
|
||||
|
||||
} // namespace Carbon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user