mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 07:11:04 +01: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:
+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