mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +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,9 +21,8 @@ void StructDeclaration::Print() const {
|
||||
void ChoiceDeclaration::Print() const {
|
||||
std::cout << "choice " << name << " {" << std::endl;
|
||||
for (auto& alternative : alternatives) {
|
||||
std::cout << "alt " << alternative.first << " ";
|
||||
PrintExp(alternative.second);
|
||||
std::cout << ";" << std::endl;
|
||||
std::cout << "alt " << alternative.first << " " << *alternative.second
|
||||
<< ";" << std::endl;
|
||||
}
|
||||
std::cout << "}" << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user