mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 06:10:14 +01:00
improve abstraction for AssocList, fix bug in optional else (#315)
* improve abstraction for AssocList, fix bug in optional else * add flag for tracing output, clean up code for output * turned off tracing by default, updated goldens, removed two examples that use pointers, shouldn't have been there yet
This commit is contained in:
@@ -21,10 +21,8 @@ auto MakeFunDef(int line_num, std::string name, Expression* ret_type,
|
||||
}
|
||||
|
||||
void PrintFunDefDepth(const FunctionDefinition* f, int depth) {
|
||||
std::cout << "fn " << f->name << " ";
|
||||
PrintExp(f->param_pattern);
|
||||
std::cout << " -> ";
|
||||
PrintExp(f->return_type);
|
||||
std::cout << "fn " << f->name << " " << *f->param_pattern << " -> "
|
||||
<< *f->return_type;
|
||||
if (f->body) {
|
||||
std::cout << " {" << std::endl;
|
||||
PrintStatement(f->body, depth);
|
||||
|
||||
Reference in New Issue
Block a user