Private unions (#492)

* changed union of Statement to be private

* changed the union in Expression to be private

* changed union in Value to be private

* changed AST constructors to be static methods

* updates to syntax unit tests
This commit is contained in:
Jeremy G. Siek
2021-04-27 14:29:13 -04:00
committed by GitHub
parent 1933cfeeeb
commit 8924f5620b
11 changed files with 1105 additions and 780 deletions
@@ -16,7 +16,8 @@ const Expression* ParenContents::AsExpression(int line_number) const {
}
const Expression* ParenContents::AsTuple(int line_number) const {
return MakeTuple(line_number, new std::vector<FieldInitializer>(fields_));
return Expression::MakeTuple(line_number,
new std::vector<FieldInitializer>(fields_));
}
} // namespace Carbon