mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 17:06:41 +00:00
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:
1 parent
98a6477233
commit
80f035874d
9 files changed
+251
-105
No files matched your search
+3
-2
@@ -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];
|
||||
}
|
||||
Reference in new issue
Block a user