mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-15 15:18:11 +00:00
Change Alternative to a class (#853)
Revives BisonWrap because this seems a reasonable use of it (avoiding the need to have an std::optional or pointer for Alternative, both of which I thought could be unclear about the intent).
This commit is contained in:
1 parent
6ab2bff69c
commit
721743bc58
7 files changed
+84
-22
No files matched your search
@@ -30,8 +30,8 @@ void Declaration::Print(llvm::raw_ostream& out) const {
|
||||
case Kind::ChoiceDeclaration: {
|
||||
const auto& choice = cast<ChoiceDeclaration>(*this);
|
||||
out << "choice " << choice.Name() << " {\n";
|
||||
for (const auto& [name, signature] : choice.Alternatives()) {
|
||||
out << "alt " << name << " " << *signature << ";\n";
|
||||
for (const auto& alt : choice.Alternatives()) {
|
||||
out << "alt " << alt.name() << " " << alt.signature() << ";\n";
|
||||
}
|
||||
out << "}\n";
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user