Restructure handling of paren expressions (#417)

* Move nontrivial logic out of `parser.ypp` into `FieldList`, rename it to `ParenContents`, make it a class, and add tests
* Use a `FieldInitializer` struct instead of `std::pair<std::string, Expression*>` to represent the fields of a tuple
This commit is contained in:
Geoff Romer
2021-04-05 10:49:25 -07:00
committed by GitHub
parent 98a6477233
commit 80f035874d
9 changed files with 251 additions and 105 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
fn main() -> Int {
var (Int,): t = (5,);
return t[0] - 5;
var (Int,): t1 = (5,);
var (Int, Int): t2 = (2, 3,);
return t1[0] - t2[0] - t2[1];
}