From 2c5f7f83a46e9b95d750595b900796661fae997e Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Tue, 28 Sep 2021 17:42:31 -0700 Subject: [PATCH] Updated parser tests --- .../expected_leo_ast/linear_regression.json | 268 +++++++++--------- .../expected_leo_ast/palindrome.json | 114 ++++---- .../expected_leo_ast/pedersen_hash.json | 62 ++-- .../expected_leo_ast/silly_sudoku.json | 104 +++---- parser/tests/serialization/json.rs | 28 +- 5 files changed, 301 insertions(+), 275 deletions(-) diff --git a/parser/tests/serialization/expected_leo_ast/linear_regression.json b/parser/tests/serialization/expected_leo_ast/linear_regression.json index fd56edd38b..f5e68ba903 100644 --- a/parser/tests/serialization/expected_leo_ast/linear_regression.json +++ b/parser/tests/serialization/expected_leo_ast/linear_regression.json @@ -5,13 +5,13 @@ "imports": {}, "aliases": {}, "circuits": { - "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"circuit Point {\\\"}\"}": { - "circuit_name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"circuit Point {\\\"}\"}", + "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit Point {\\\"}\"}": { + "circuit_name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit Point {\\\"}\"}", "core_mapping": null, "members": [ { "CircuitVariable": [ - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x: i32,\\\"}\"}", + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x: i32,\\\"}\"}", { "IntegerType": "I32" } @@ -19,7 +19,7 @@ }, { "CircuitVariable": [ - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y: i32,\\\"}\"}", + "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y: i32,\\\"}\"}", { "IntegerType": "I32" } @@ -28,11 +28,11 @@ { "CircuitFunction": { "annotations": [], - "identifier": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}", + "identifier": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -42,7 +42,7 @@ }, { "Variable": { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -58,14 +58,14 @@ "Return": { "expression": { "CircuitInit": { - "name": "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}", + "name": "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}", "expression": null }, { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}", "expression": null } ] @@ -79,17 +79,17 @@ } ] }, - "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":9,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"circuit LinearRegression {\\\"}\"}": { - "circuit_name": "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":9,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"circuit LinearRegression {\\\"}\"}", + "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":9,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit LinearRegression {\\\"}\"}": { + "circuit_name": "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":9,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit LinearRegression {\\\"}\"}", "core_mapping": null, "members": [ { "CircuitVariable": [ - "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":5,\\\"col_stop\\\":11,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" points: [Point; 5],\\\"}\"}", + "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":5,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" points: [Point; 5],\\\"}\"}", { "Array": [ { - "Identifier": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":14,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" points: [Point; 5],\\\"}\"}" + "Identifier": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":14,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" points: [Point; 5],\\\"}\"}" }, [ { @@ -103,17 +103,17 @@ { "CircuitFunction": { "annotations": [], - "identifier": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}", + "identifier": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}", + "identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}", "const_": false, "mutable": true, "type_": { "Array": [ { - "Identifier": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}" + "Identifier": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}" }, [ { @@ -132,10 +132,10 @@ "Return": { "expression": { "CircuitInit": { - "name": "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return Self { points };\\\"}\"}", + "name": "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { points };\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return Self { points };\\\"}\"}", + "identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { points };\\\"}\"}", "expression": null } ] @@ -150,10 +150,10 @@ { "CircuitFunction": { "annotations": [], - "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":14,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function slope(self) -> i32 { \\\"}\"}", + "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":14,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function slope(self) -> i32 { \\\"}\"}", "input": [ { - "SelfKeyword": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":20,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function slope(self) -> i32 { \\\"}\"}" + "SelfKeyword": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":20,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function slope(self) -> i32 { \\\"}\"}" } ], "output": { @@ -167,7 +167,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let num_points = 5i32;\\\"}\"}" + "identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32;\\\"}\"}" } ], "type_": null, @@ -187,7 +187,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let x_sum = 0i32; \\\"}\"}" + "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32; \\\"}\"}" } ], "type_": null, @@ -207,7 +207,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let y_sum = 0i32; \\\"}\"}" + "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32; \\\"}\"}" } ], "type_": null, @@ -227,7 +227,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let xy_sum = 0i32; \\\"}\"}" + "identifier": "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let xy_sum = 0i32; \\\"}\"}" } ], "type_": null, @@ -247,7 +247,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let x2_sum = 0i32; \\\"}\"}" + "identifier": "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x2_sum = 0i32; \\\"}\"}" } ], "type_": null, @@ -263,7 +263,7 @@ }, { "Iteration": { - "variable": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" for i in 0..5 {\\\"}\"}", + "variable": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for i in 0..5 {\\\"}\"}", "start": { "Value": { "Implicit": "0" @@ -281,7 +281,7 @@ "Assign": { "operation": "Add", "assignee": { - "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", + "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", "accesses": [] }, "value": { @@ -291,18 +291,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" } } }, - "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", "type_": null } } @@ -312,7 +312,7 @@ "Assign": { "operation": "Add", "assignee": { - "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}", + "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}", "accesses": [] }, "value": { @@ -322,18 +322,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" } } }, - "name": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}", + "name": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}", "type_": null } } @@ -343,7 +343,7 @@ "Assign": { "operation": "Add", "assignee": { - "identifier": "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", + "identifier": "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", "accesses": [] }, "value": { @@ -355,18 +355,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":23,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":23,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":35,\\\"col_stop\\\":36,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":35,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" } } }, - "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":38,\\\"col_stop\\\":39,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", + "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":38,\\\"col_stop\\\":39,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", "type_": null } }, @@ -377,18 +377,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":42,\\\"col_stop\\\":46,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":42,\\\"col_stop\\\":46,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":47,\\\"col_stop\\\":53,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":47,\\\"col_stop\\\":53,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":54,\\\"col_stop\\\":55,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":54,\\\"col_stop\\\":55,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" } } }, - "name": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":57,\\\"col_stop\\\":58,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", + "name": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":57,\\\"col_stop\\\":58,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}", "type_": null } }, @@ -401,7 +401,7 @@ "Assign": { "operation": "Add", "assignee": { - "identifier": "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", + "identifier": "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", "accesses": [] }, "value": { @@ -413,18 +413,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":23,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":23,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":35,\\\"col_stop\\\":36,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":35,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" } } }, - "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":38,\\\"col_stop\\\":39,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":38,\\\"col_stop\\\":39,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", "type_": null } }, @@ -435,18 +435,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":42,\\\"col_stop\\\":46,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":42,\\\"col_stop\\\":46,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":47,\\\"col_stop\\\":53,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":47,\\\"col_stop\\\":53,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":54,\\\"col_stop\\\":55,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":54,\\\"col_stop\\\":55,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" } } }, - "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":57,\\\"col_stop\\\":58,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":57,\\\"col_stop\\\":58,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}", "type_": null } }, @@ -465,7 +465,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" + "identifier": "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" } ], "type_": null, @@ -474,10 +474,10 @@ "left": { "Binary": { "left": { - "Identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":26,\\\"col_stop\\\":36,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" + "Identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":26,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":39,\\\"col_stop\\\":45,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" + "Identifier": "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":39,\\\"col_stop\\\":45,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" }, "op": "Mul" } @@ -485,10 +485,10 @@ "right": { "Binary": { "left": { - "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":50,\\\"col_stop\\\":55,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" + "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":50,\\\"col_stop\\\":55,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":58,\\\"col_stop\\\":63,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" + "Identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":58,\\\"col_stop\\\":63,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" }, "op": "Mul" } @@ -504,7 +504,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":13,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" + "identifier": "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":13,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" } ], "type_": null, @@ -513,10 +513,10 @@ "left": { "Binary": { "left": { - "Identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":28,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" + "Identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":28,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":41,\\\"col_stop\\\":47,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" + "Identifier": "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":41,\\\"col_stop\\\":47,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" }, "op": "Mul" } @@ -524,10 +524,10 @@ "right": { "Binary": { "left": { - "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":52,\\\"col_stop\\\":57,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" + "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":52,\\\"col_stop\\\":57,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":60,\\\"col_stop\\\":65,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" + "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":60,\\\"col_stop\\\":65,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" }, "op": "Mul" } @@ -543,17 +543,17 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" + "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" } ], "type_": null, "value": { "Binary": { "left": { - "Identifier": "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":21,\\\"col_stop\\\":30,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" + "Identifier": "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":21,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":33,\\\"col_stop\\\":44,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" + "Identifier": "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":33,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" }, "op": "Div" } @@ -563,7 +563,7 @@ { "Return": { "expression": { - "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return slope;\\\"}\"}" + "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return slope;\\\"}\"}" } } } @@ -574,14 +574,14 @@ { "CircuitFunction": { "annotations": [], - "identifier": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":39,\\\"line_stop\\\":39,\\\"col_start\\\":14,\\\"col_stop\\\":20,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}", + "identifier": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":39,\\\"line_stop\\\":39,\\\"col_start\\\":14,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}", "input": [ { - "SelfKeyword": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":39,\\\"line_stop\\\":39,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}" + "SelfKeyword": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":39,\\\"line_stop\\\":39,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}" }, { "Variable": { - "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":39,\\\"line_stop\\\":39,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}", + "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":39,\\\"line_stop\\\":39,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -601,7 +601,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":40,\\\"line_stop\\\":40,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let num_points = 5i32; \\\"}\"}" + "identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":40,\\\"line_stop\\\":40,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32; \\\"}\"}" } ], "type_": null, @@ -621,7 +621,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let x_sum = 0i32;\\\"}\"}" + "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32;\\\"}\"}" } ], "type_": null, @@ -641,7 +641,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":43,\\\"line_stop\\\":43,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let y_sum = 0i32;\\\"}\"}" + "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":43,\\\"line_stop\\\":43,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32;\\\"}\"}" } ], "type_": null, @@ -657,7 +657,7 @@ }, { "Iteration": { - "variable": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":44,\\\"line_stop\\\":44,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" for i in 0..5 {\\\"}\"}", + "variable": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":44,\\\"line_stop\\\":44,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for i in 0..5 {\\\"}\"}", "start": { "Value": { "Implicit": "0" @@ -675,7 +675,7 @@ "Assign": { "operation": "Add", "assignee": { - "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", + "identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", "accesses": [] }, "value": { @@ -685,18 +685,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" } } }, - "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", + "name": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}", "type_": null } } @@ -706,7 +706,7 @@ "Assign": { "operation": "Add", "assignee": { - "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}", + "identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}", "accesses": [] }, "value": { @@ -716,18 +716,18 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" }, - "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}", + "name": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" } } }, - "name": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}", + "name": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}", "type_": null } } @@ -744,15 +744,15 @@ "left": { "Binary": { "left": { - "Identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":17,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" + "Identifier": "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":17,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" }, "right": { "Binary": { "left": { - "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":25,\\\"col_stop\\\":30,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" + "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":25,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":33,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" + "Identifier": "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":33,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" }, "op": "Mul" } @@ -761,7 +761,7 @@ } }, "right": { - "Identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":42,\\\"col_stop\\\":52,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" + "Identifier": "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":42,\\\"col_stop\\\":52,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" }, "op": "Div" } @@ -777,13 +777,13 @@ }, "global_consts": {}, "functions": { - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}": { + "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}": { "annotations": [], - "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}", + "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -793,7 +793,7 @@ }, { "Variable": { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -822,13 +822,13 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" + "identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" } ], "type_": { "Array": [ { - "Identifier": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" + "Identifier": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" }, [ { @@ -843,14 +843,14 @@ { "Expression": { "CircuitInit": { - "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}", + "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" + "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" }, "right": { "Value": { @@ -862,11 +862,11 @@ } }, { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" + "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" }, "right": { "Value": { @@ -884,14 +884,14 @@ { "Expression": { "CircuitInit": { - "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}", + "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" + "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" }, "right": { "Value": { @@ -903,11 +903,11 @@ } }, { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" + "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" }, "right": { "Value": { @@ -925,14 +925,14 @@ { "Expression": { "CircuitInit": { - "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}", + "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" + "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" }, "right": { "Value": { @@ -944,11 +944,11 @@ } }, { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" + "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" }, "right": { "Value": { @@ -966,14 +966,14 @@ { "Expression": { "CircuitInit": { - "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}", + "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" + "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" }, "right": { "Value": { @@ -985,11 +985,11 @@ } }, { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" + "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" }, "right": { "Value": { @@ -1007,14 +1007,14 @@ { "Expression": { "CircuitInit": { - "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}", + "name": "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}", + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" + "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" }, "right": { "Value": { @@ -1026,11 +1026,11 @@ } }, { - "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}", + "identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}", "expression": { "Binary": { "left": { - "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" + "Identifier": "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" }, "right": { "Value": { @@ -1056,7 +1056,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":7,\\\"col_stop\\\":10,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" + "identifier": "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":7,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" } ], "type_": null, @@ -1065,14 +1065,14 @@ "function": { "CircuitStaticFunctionAccess": { "circuit": { - "Identifier": "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":13,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" + "Identifier": "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":13,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" }, - "name": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":31,\\\"col_stop\\\":34,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" + "name": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":31,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" } }, "arguments": [ { - "Identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":35,\\\"col_stop\\\":41,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" + "Identifier": "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":35,\\\"col_stop\\\":41,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" } ] } @@ -1085,7 +1085,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" + "identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" } ], "type_": null, @@ -1094,9 +1094,9 @@ "function": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" + "Identifier": "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" }, - "name": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":19,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}", + "name": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":19,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}", "type_": null } }, @@ -1111,7 +1111,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" + "identifier": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" } ], "type_": null, @@ -1120,15 +1120,15 @@ "function": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":16,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" + "Identifier": "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":16,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" }, - "name": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":20,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}", + "name": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":20,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}", "type_": null } }, "arguments": [ { - "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" + "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" } ] } @@ -1142,12 +1142,12 @@ "elements": [ { "Expression": { - "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":11,\\\"col_stop\\\":16,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return [slope, offset];\\\"}\"}" + "Identifier": "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":11,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return [slope, offset];\\\"}\"}" } }, { "Expression": { - "Identifier": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/linear-regression/src/main.leo\\\",\\\"content\\\":\\\" return [slope, offset];\\\"}\"}" + "Identifier": "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return [slope, offset];\\\"}\"}" } } ] diff --git a/parser/tests/serialization/expected_leo_ast/palindrome.json b/parser/tests/serialization/expected_leo_ast/palindrome.json index d66a997eb4..32c7313219 100644 --- a/parser/tests/serialization/expected_leo_ast/palindrome.json +++ b/parser/tests/serialization/expected_leo_ast/palindrome.json @@ -7,13 +7,13 @@ "circuits": {}, "global_consts": {}, "functions": { - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}": { + "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}": { "annotations": [], - "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}", + "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}", + "identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -37,11 +37,11 @@ "expression": { "Call": { "function": { - "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":12,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}" + "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":12,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}" }, "arguments": [ { - "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":26,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}" + "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":26,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}" } ] } @@ -51,13 +51,13 @@ ] } }, - "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}": { + "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}": { "annotations": [], - "identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}", + "identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}", + "identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -82,7 +82,7 @@ "variable_names": [ { "mutable": false, - "identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":11,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" const str_len = 20u32; // saving const for convenience\\\"}\"}" + "identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":11,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const str_len = 20u32; // saving const for convenience\\\"}\"}" } ], "type_": null, @@ -102,7 +102,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let result = true;\\\"}\"}" + "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = true;\\\"}\"}" } ], "type_": null, @@ -119,7 +119,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":9,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let processed = 0u8;\\\"}\"}" + "identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":9,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let processed = 0u8;\\\"}\"}" } ], "type_": null, @@ -135,7 +135,7 @@ }, { "Iteration": { - "variable": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}", + "variable": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}", "start": { "Value": { "Implicit": "0" @@ -144,7 +144,7 @@ "stop": { "Binary": { "left": { - "Identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":22,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}" + "Identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":22,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}" }, "right": { "Value": { @@ -163,17 +163,17 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" + "identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" } ], "type_": null, "value": { "ArrayAccess": { "array": { - "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":25,\\\"col_stop\\\":28,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" + "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":25,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" }, "index": { - "Identifier": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":29,\\\"col_stop\\\":34,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" + "Identifier": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":29,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" } } } @@ -184,7 +184,7 @@ "condition": { "Binary": { "left": { - "Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":12,\\\"col_stop\\\":21,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if start_sym != ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":12,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if start_sym != ' ' {\\\"}\"}" }, "right": { "Value": { @@ -206,7 +206,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let skipped = 0u8;\\\"}\"}" + "identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let skipped = 0u8;\\\"}\"}" } ], "type_": null, @@ -226,7 +226,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let end_empty = 0u8;\\\"}\"}" + "identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_empty = 0u8;\\\"}\"}" } ], "type_": null, @@ -246,7 +246,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" let end_sym = ' ';\\\"}\"}" + "identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_sym = ' ';\\\"}\"}" } ], "type_": null, @@ -263,11 +263,11 @@ }, { "Iteration": { - "variable": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":17,\\\"col_stop\\\":20,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}", + "variable": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":17,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}", "start": { "Binary": { "left": { - "Identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}" + "Identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}" }, "right": { "Value": { @@ -278,7 +278,7 @@ } }, "stop": { - "Identifier": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":39,\\\"col_stop\\\":44,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}" + "Identifier": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":39,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}" }, "inclusive": false, "block": { @@ -294,10 +294,10 @@ "left": { "ArrayAccess": { "array": { - "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" }, "index": { - "Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" } } }, @@ -316,10 +316,10 @@ "right": { "Binary": { "left": { - "Identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":39,\\\"col_stop\\\":46,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":39,\\\"col_stop\\\":46,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":50,\\\"col_stop\\\":59,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":50,\\\"col_stop\\\":59,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" }, "op": "Eq" } @@ -330,7 +330,7 @@ "right": { "Binary": { "left": { - "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":63,\\\"col_stop\\\":70,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":63,\\\"col_stop\\\":70,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" }, "right": { "Value": { @@ -353,16 +353,16 @@ "Assign": { "operation": "Assign", "assignee": { - "identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":21,\\\"col_stop\\\":28,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}", + "identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":21,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}", "accesses": [] }, "value": { "ArrayAccess": { "array": { - "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":31,\\\"col_stop\\\":34,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}" + "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":31,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}" }, "index": { - "Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":35,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}" + "Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":35,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}" } } } @@ -377,13 +377,13 @@ "Assign": { "operation": "Assign", "assignee": { - "identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":21,\\\"col_stop\\\":30,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}", + "identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":21,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}", "accesses": [] }, "value": { "Binary": { "left": { - "Identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":33,\\\"col_stop\\\":42,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}" + "Identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":33,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}" }, "right": { "Value": { @@ -402,10 +402,10 @@ "left": { "ArrayAccess": { "array": { - "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}" }, "index": { - "Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":28,\\\"col_stop\\\":31,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":28,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}" } } }, @@ -427,13 +427,13 @@ "Assign": { "operation": "Assign", "assignee": { - "identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}", + "identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}", "accesses": [] }, "value": { "Binary": { "left": { - "Identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":35,\\\"col_stop\\\":42,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}" + "Identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":35,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}" }, "right": { "Value": { @@ -464,7 +464,7 @@ "condition": { "Binary": { "left": { - "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":16,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if end_sym != ' ' {\\\"}\"}" + "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":16,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if end_sym != ' ' {\\\"}\"}" }, "right": { "Value": { @@ -542,10 +542,10 @@ ], "parameters": [ { - "Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":51,\\\"col_stop\\\":60,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}" + "Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":51,\\\"col_stop\\\":60,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}" }, { - "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":62,\\\"col_stop\\\":69,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}" + "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":62,\\\"col_stop\\\":69,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}" } ] } @@ -555,7 +555,7 @@ { "Conditional": { "condition": { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":20,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" if result {\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":20,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if result {\\\"}\"}" }, "block": { "statements": [ @@ -563,16 +563,16 @@ "Assign": { "operation": "Assign", "assignee": { - "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":21,\\\"col_stop\\\":27,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}", + "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":21,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}", "accesses": [] }, "value": { "Binary": { "left": { - "Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":31,\\\"col_stop\\\":40,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}" + "Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":31,\\\"col_stop\\\":40,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":44,\\\"col_stop\\\":51,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}" + "Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":44,\\\"col_stop\\\":51,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}" }, "op": "Eq" } @@ -588,13 +588,13 @@ "Assign": { "operation": "Assign", "assignee": { - "identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}", + "identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}", "accesses": [] }, "value": { "Binary": { "left": { - "Identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":29,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}" + "Identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":29,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}" }, "right": { "Value": { @@ -667,7 +667,7 @@ ], "parameters": [ { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":34,\\\"col_stop\\\":40,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Result is: {}\\\\\\\", result);\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":34,\\\"col_stop\\\":40,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Result is: {}\\\\\\\", result);\\\"}\"}" } ] } @@ -677,21 +677,21 @@ { "Return": { "expression": { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":12,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" return result;\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":12,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return result;\\\"}\"}" } } } ] } }, - "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}": { + "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}": { "annotations": [ { "arguments": [], - "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":51,\\\"line_stop\\\":51,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"@test\\\"}\"}" + "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":51,\\\"line_stop\\\":51,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test\\\"}\"}" } ], - "identifier": "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}", + "identifier": "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}", "input": [], "output": null, "block": { @@ -702,7 +702,7 @@ "Assert": { "Call": { "function": { - "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"a b a \\\\\\\"));\\\"}\"}" + "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"a b a \\\\\\\"));\\\"}\"}" }, "arguments": [ { @@ -783,7 +783,7 @@ "Assert": { "Call": { "function": { - "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"😀😀😀😀😀 😀😀😀😀😀\\\\\\\"));\\\"}\"}" + "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"😀😀😀😀😀 😀😀😀😀😀\\\\\\\"));\\\"}\"}" }, "arguments": [ { @@ -864,7 +864,7 @@ "Assert": { "Call": { "function": { - "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"borrow or rob \\\\\\\"));\\\"}\"}" + "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"borrow or rob \\\\\\\"));\\\"}\"}" }, "arguments": [ { @@ -945,7 +945,7 @@ "Assert": { "Call": { "function": { - "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"bbbb aaaa aaaa bbbb\\\\\\\"));\\\"}\"}" + "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"bbbb aaaa aaaa bbbb\\\\\\\"));\\\"}\"}" }, "arguments": [ { @@ -1026,7 +1026,7 @@ "Assert": { "Call": { "function": { - "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"aaaaaaaaaaaaaaaaaaaa\\\\\\\"));\\\"}\"}" + "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"aaaaaaaaaaaaaaaaaaaa\\\\\\\"));\\\"}\"}" }, "arguments": [ { @@ -1107,7 +1107,7 @@ "Assert": { "Call": { "function": { - "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/palindrome/src/main.leo\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"taco cat \\\\\\\"));\\\"}\"}" + "Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"taco cat \\\\\\\"));\\\"}\"}" }, "arguments": [ { diff --git a/parser/tests/serialization/expected_leo_ast/pedersen_hash.json b/parser/tests/serialization/expected_leo_ast/pedersen_hash.json index f6cf77a985..a74e50f4e9 100644 --- a/parser/tests/serialization/expected_leo_ast/pedersen_hash.json +++ b/parser/tests/serialization/expected_leo_ast/pedersen_hash.json @@ -5,13 +5,13 @@ "imports": {}, "aliases": {}, "circuits": { - "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":21,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\"circuit PedersenHash {\\\"}\"}": { - "circuit_name": "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":21,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\"circuit PedersenHash {\\\"}\"}", + "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit PedersenHash {\\\"}\"}": { + "circuit_name": "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit PedersenHash {\\\"}\"}", "core_mapping": null, "members": [ { "CircuitVariable": [ - "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":5,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" parameters: [group; 256];\\\"}\"}", + "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":5,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" parameters: [group; 256];\\\"}\"}", { "Array": [ "Group", @@ -27,11 +27,11 @@ { "CircuitFunction": { "annotations": [], - "identifier": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" function new(parameters: [group; 256]) -> Self {\\\"}\"}", + "identifier": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(parameters: [group; 256]) -> Self {\\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":18,\\\"col_stop\\\":28,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" function new(parameters: [group; 256]) -> Self {\\\"}\"}", + "identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":18,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(parameters: [group; 256]) -> Self {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -54,12 +54,12 @@ "Return": { "expression": { "CircuitInit": { - "name": "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}", + "name": "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":23,\\\"col_stop\\\":33,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}", + "identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":23,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}", "expression": { - "Identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":35,\\\"col_stop\\\":45,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}" + "Identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":35,\\\"col_stop\\\":45,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}" } } ] @@ -74,14 +74,14 @@ { "CircuitFunction": { "annotations": [], - "identifier": "{\"name\":\"hash\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}", + "identifier": "{\"name\":\"hash\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}", "input": [ { - "SelfKeyword": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":19,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}" + "SelfKeyword": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":19,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}" }, { "Variable": { - "identifier": "{\"name\":\"bits\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":25,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}", + "identifier": "{\"name\":\"bits\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":25,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -106,7 +106,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" let digest: group = 0group;\\\"}\"}" + "identifier": "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let digest: group = 0group;\\\"}\"}" } ], "type_": "Group", @@ -121,7 +121,7 @@ }, { "Iteration": { - "variable": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" for i in 0..256 {\\\"}\"}", + "variable": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for i in 0..256 {\\\"}\"}", "start": { "Value": { "Implicit": "0" @@ -140,10 +140,10 @@ "condition": { "ArrayAccess": { "array": { - "Identifier": "{\"name\":\"bits\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" if bits[i] {\\\"}\"}" + "Identifier": "{\"name\":\"bits\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if bits[i] {\\\"}\"}" }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" if bits[i] {\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if bits[i] {\\\"}\"}" } } }, @@ -153,7 +153,7 @@ "Assign": { "operation": "Add", "assignee": { - "identifier": "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":17,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}", + "identifier": "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":17,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}", "accesses": [] }, "value": { @@ -161,14 +161,14 @@ "array": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":27,\\\"col_stop\\\":31,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" + "Identifier": "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":27,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" }, - "name": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":32,\\\"col_stop\\\":42,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}", + "name": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":32,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}", "type_": null } }, "index": { - "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":43,\\\"col_stop\\\":44,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" + "Identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":43,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" } } } @@ -186,7 +186,7 @@ { "Return": { "expression": { - "Identifier": "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":16,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" return digest;\\\"}\"}" + "Identifier": "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":16,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return digest;\\\"}\"}" } } } @@ -199,13 +199,13 @@ }, "global_consts": {}, "functions": { - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}": { + "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}": { "annotations": [], - "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}", + "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"hash_input\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":15,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}", + "identifier": "{\"name\":\"hash_input\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":15,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -222,7 +222,7 @@ }, { "Variable": { - "identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":46,\\\"col_stop\\\":56,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}", + "identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":46,\\\"col_stop\\\":56,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}", "const_": true, "mutable": false, "type_": { @@ -247,7 +247,7 @@ "variable_names": [ { "mutable": false, - "identifier": "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":11,\\\"col_stop\\\":19,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" + "identifier": "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":11,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" } ], "type_": null, @@ -256,14 +256,14 @@ "function": { "CircuitStaticFunctionAccess": { "circuit": { - "Identifier": "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":22,\\\"col_stop\\\":34,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" + "Identifier": "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":22,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" }, - "name": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":36,\\\"col_stop\\\":39,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" + "name": "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":36,\\\"col_stop\\\":39,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" } }, "arguments": [ { - "Identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":40,\\\"col_stop\\\":50,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" + "Identifier": "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":40,\\\"col_stop\\\":50,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" } ] } @@ -277,15 +277,15 @@ "function": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":12,\\\"col_stop\\\":20,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}" + "Identifier": "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":12,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}" }, - "name": "{\"name\":\"hash\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}", + "name": "{\"name\":\"hash\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}", "type_": null } }, "arguments": [ { - "Identifier": "{\"name\":\"hash_input\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":26,\\\"col_stop\\\":36,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/pedersen-hash/src/main.leo\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}" + "Identifier": "{\"name\":\"hash_input\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":26,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}" } ] } diff --git a/parser/tests/serialization/expected_leo_ast/silly_sudoku.json b/parser/tests/serialization/expected_leo_ast/silly_sudoku.json index c9f77b117a..167a3faddb 100644 --- a/parser/tests/serialization/expected_leo_ast/silly_sudoku.json +++ b/parser/tests/serialization/expected_leo_ast/silly_sudoku.json @@ -5,10 +5,10 @@ { "package_or_packages": { "Package": { - "name": "{\"name\":\"lib\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"import lib.SillySudoku;\\\"}\"}", + "name": "{\"name\":\"lib\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import lib.SillySudoku;\\\"}\"}", "access": { "Symbol": { - "symbol": "{\"name\":\"SillySudoku\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":23,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"import lib.SillySudoku;\\\"}\"}", + "symbol": "{\"name\":\"SillySudoku\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import lib.SillySudoku;\\\"}\"}", "alias": null } } @@ -21,13 +21,13 @@ "circuits": {}, "global_consts": {}, "functions": { - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}": { + "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}": { "annotations": [], - "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}", + "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":15,\\\"col_stop\\\":21,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}", + "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":15,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -49,7 +49,7 @@ }, { "Variable": { - "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":37,\\\"col_stop\\\":43,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}", + "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":37,\\\"col_stop\\\":43,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(puzzle: [u8; (3, 3)], answer: [u8; (3, 3)]) -> bool {\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -173,7 +173,7 @@ ], "parameters": [ { - "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"{}\\\\\\\", puzzle);\\\"}\"}" + "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"{}\\\\\\\", puzzle);\\\"}\"}" } ] } @@ -186,18 +186,18 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"sudoku\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}" + "identifier": "{\"name\":\"sudoku\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}" } ], "type_": null, "value": { "CircuitInit": { - "name": "{\"name\":\"SillySudoku\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":18,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}", + "name": "{\"name\":\"SillySudoku\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":18,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}", "members": [ { - "identifier": "{\"name\":\"puzzle_grid\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":32,\\\"col_stop\\\":43,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}", + "identifier": "{\"name\":\"puzzle_grid\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":32,\\\"col_stop\\\":43,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}", "expression": { - "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":45,\\\"col_stop\\\":51,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}" + "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":45,\\\"col_stop\\\":51,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let sudoku = SillySudoku { puzzle_grid: puzzle };\\\"}\"}" } } ] @@ -305,7 +305,7 @@ ], "parameters": [ { - "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"{}\\\\\\\", answer);\\\"}\"}" + "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"{}\\\\\\\", answer);\\\"}\"}" } ] } @@ -318,7 +318,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}" + "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}" } ], "type_": null, @@ -327,15 +327,15 @@ "function": { "CircuitMemberAccess": { "circuit": { - "Identifier": "{\"name\":\"sudoku\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}" + "Identifier": "{\"name\":\"sudoku\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}" }, - "name": "{\"name\":\"solve\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":25,\\\"col_stop\\\":30,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}", + "name": "{\"name\":\"solve\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":25,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}", "type_": null } }, "arguments": [ { - "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}" + "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = sudoku.solve(answer);\\\"}\"}" } ] } @@ -401,7 +401,7 @@ ], "parameters": [ { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":38,\\\"col_stop\\\":44,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"The answer is {}.\\\\\\\", result);\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":38,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"The answer is {}.\\\\\\\", result);\\\"}\"}" } ] } @@ -411,21 +411,21 @@ { "Return": { "expression": { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":12,\\\"col_stop\\\":18,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" return result;\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":12,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return result;\\\"}\"}" } } } ] } }, - "{\"name\":\"test_solve_pass\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function test_solve_pass() {\\\"}\"}": { + "{\"name\":\"test_solve_pass\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_solve_pass() {\\\"}\"}": { "annotations": [ { "arguments": [], - "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"@test\\\"}\"}" + "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test\\\"}\"}" } ], - "identifier": "{\"name\":\"test_solve_pass\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function test_solve_pass() {\\\"}\"}", + "identifier": "{\"name\":\"test_solve_pass\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_solve_pass() {\\\"}\"}", "input": [], "output": null, "block": { @@ -436,7 +436,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let puzzle: [u8; (3, 3)] = [[0, 2, 0],\\\"}\"}" + "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let puzzle: [u8; (3, 3)] = [[0, 2, 0],\\\"}\"}" } ], "type_": { @@ -555,7 +555,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let answer: [u8; (3, 3)] = [[1, 2, 3],\\\"}\"}" + "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let answer: [u8; (3, 3)] = [[1, 2, 3],\\\"}\"}" } ], "type_": { @@ -674,21 +674,21 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" } ], "type_": null, "value": { "Call": { "function": { - "Identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" }, "arguments": [ { - "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" }, { - "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" } ] } @@ -706,7 +706,7 @@ } }, "right": { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.assert(true == result);\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(true == result);\\\"}\"}" }, "op": "Eq" } @@ -717,14 +717,14 @@ ] } }, - "{\"name\":\"test_solve_fail\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function test_solve_fail() {\\\"}\"}": { + "{\"name\":\"test_solve_fail\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_solve_fail() {\\\"}\"}": { "annotations": [ { "arguments": [], - "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"@test\\\"}\"}" + "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test\\\"}\"}" } ], - "identifier": "{\"name\":\"test_solve_fail\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function test_solve_fail() {\\\"}\"}", + "identifier": "{\"name\":\"test_solve_fail\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":10,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_solve_fail() {\\\"}\"}", "input": [], "output": null, "block": { @@ -735,7 +735,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":43,\\\"line_stop\\\":43,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let puzzle: [u8; (3, 3)] = [[0, 2, 0],\\\"}\"}" + "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":43,\\\"line_stop\\\":43,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let puzzle: [u8; (3, 3)] = [[0, 2, 0],\\\"}\"}" } ], "type_": { @@ -854,7 +854,7 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":47,\\\"line_stop\\\":47,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let answer: [u8; (3, 3)] = [[1, 2, 3],\\\"}\"}" + "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":47,\\\"line_stop\\\":47,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let answer: [u8; (3, 3)] = [[1, 2, 3],\\\"}\"}" } ], "type_": { @@ -973,21 +973,21 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" } ], "type_": null, "value": { "Call": { "function": { - "Identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" }, "arguments": [ { - "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" }, { - "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" } ] } @@ -1005,7 +1005,7 @@ } }, "right": { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":29,\\\"col_stop\\\":35,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.assert(false == result);\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":29,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(false == result);\\\"}\"}" }, "op": "Eq" } @@ -1016,20 +1016,20 @@ ] } }, - "{\"name\":\"test_solve_with_input\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":10,\\\"col_stop\\\":31,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function test_solve_with_input(\\\"}\"}": { + "{\"name\":\"test_solve_with_input\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":10,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_solve_with_input(\\\"}\"}": { "annotations": [ { "arguments": [ "test_input" ], - "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"@test(test_input)\\\"}\"}" + "name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test(test_input)\\\"}\"}" } ], - "identifier": "{\"name\":\"test_solve_with_input\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":10,\\\"col_stop\\\":31,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\"function test_solve_with_input(\\\"}\"}", + "identifier": "{\"name\":\"test_solve_with_input\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":10,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_solve_with_input(\\\"}\"}", "input": [ { "Variable": { - "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":5,\\\"col_stop\\\":11,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" puzzle: [u8; (3, 3)],\\\"}\"}", + "identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":5,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" puzzle: [u8; (3, 3)],\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -1051,7 +1051,7 @@ }, { "Variable": { - "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":5,\\\"col_stop\\\":11,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" answer: [u8; (3, 3)],\\\"}\"}", + "identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":62,\\\"line_stop\\\":62,\\\"col_start\\\":5,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" answer: [u8; (3, 3)],\\\"}\"}", "const_": false, "mutable": true, "type_": { @@ -1073,7 +1073,7 @@ }, { "Variable": { - "identifier": "{\"name\":\"expected\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":5,\\\"col_stop\\\":13,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" expected: bool\\\"}\"}", + "identifier": "{\"name\":\"expected\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":5,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" expected: bool\\\"}\"}", "const_": false, "mutable": true, "type_": "Boolean" @@ -1089,21 +1089,21 @@ "variable_names": [ { "mutable": true, - "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" } ], "type_": null, "value": { "Call": { "function": { - "Identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" }, "arguments": [ { - "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"puzzle\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" }, { - "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" + "Identifier": "{\"name\":\"answer\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":31,\\\"col_stop\\\":37,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = main(puzzle, answer);\\\"}\"}" } ] } @@ -1175,10 +1175,10 @@ ], "parameters": [ { - "Identifier": "{\"name\":\"expected\",\"span\":\"{\\\"line_start\\\":68,\\\"line_stop\\\":68,\\\"col_start\\\":40,\\\"col_stop\\\":48,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"expected {}, got {}\\\\\\\", expected, result);\\\"}\"}" + "Identifier": "{\"name\":\"expected\",\"span\":\"{\\\"line_start\\\":68,\\\"line_stop\\\":68,\\\"col_start\\\":40,\\\"col_stop\\\":48,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"expected {}, got {}\\\\\\\", expected, result);\\\"}\"}" }, { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":68,\\\"line_stop\\\":68,\\\"col_start\\\":50,\\\"col_stop\\\":56,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.log(\\\\\\\"expected {}, got {}\\\\\\\", expected, result);\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":68,\\\"line_stop\\\":68,\\\"col_start\\\":50,\\\"col_stop\\\":56,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"expected {}, got {}\\\\\\\", expected, result);\\\"}\"}" } ] } @@ -1191,10 +1191,10 @@ "Assert": { "Binary": { "left": { - "Identifier": "{\"name\":\"expected\",\"span\":\"{\\\"line_start\\\":70,\\\"line_stop\\\":70,\\\"col_start\\\":20,\\\"col_stop\\\":28,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.assert(expected == result);\\\"}\"}" + "Identifier": "{\"name\":\"expected\",\"span\":\"{\\\"line_start\\\":70,\\\"line_stop\\\":70,\\\"col_start\\\":20,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(expected == result);\\\"}\"}" }, "right": { - "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":70,\\\"line_stop\\\":70,\\\"col_start\\\":32,\\\"col_stop\\\":38,\\\"path\\\":\\\"/Users/pranav/work/Aleo/leo/examples/silly-sudoku/src/main.leo\\\",\\\"content\\\":\\\" console.assert(expected == result);\\\"}\"}" + "Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":70,\\\"line_stop\\\":70,\\\"col_start\\\":32,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(expected == result);\\\"}\"}" }, "op": "Eq" } diff --git a/parser/tests/serialization/json.rs b/parser/tests/serialization/json.rs index 0586647ef2..0d95bd699a 100644 --- a/parser/tests/serialization/json.rs +++ b/parser/tests/serialization/json.rs @@ -99,6 +99,7 @@ fn test_serialize_no_span() { // Serializes the ast into JSON format. let mut serialized_ast: serde_json::Value = serde_json::to_value(ast.as_repr()).unwrap(); remove_key_from_json(&mut serialized_ast, "span"); + serialized_ast = normalize_json_value(serialized_ast); // Load the expected ast. let expected: serde_json::Value = serde_json::from_reader(json_reader).unwrap(); @@ -108,7 +109,7 @@ fn test_serialize_no_span() { clean(); } -// Helper function to recursively filter keys from AST JSON. +// Helper functions to recursively filter keys from AST JSON. // Redeclaring here since we don't want to make this public. fn remove_key_from_json(value: &mut serde_json::Value, key: &str) { match value { @@ -127,6 +128,31 @@ fn remove_key_from_json(value: &mut serde_json::Value, key: &str) { } } +// Helper function to normalize AST +// Redeclaring here because we don't want to make this public +fn normalize_json_value(value: serde_json::Value) -> serde_json::Value { + match value { + serde_json::Value::Array(vec) => { + let orig_length = vec.len(); + let mut new_vec: Vec = vec + .into_iter() + .filter(|v| !matches!(v, serde_json::Value::Object(map) if map.is_empty())) + .map(normalize_json_value) + .collect(); + + if orig_length == 2 && new_vec.len() == 1 { + new_vec.pop().unwrap() + } else { + serde_json::Value::Array(new_vec) + } + } + serde_json::Value::Object(map) => { + serde_json::Value::Object(map.into_iter().map(|(k, v)| (k, normalize_json_value(v))).collect()) + } + _ => value, + } +} + // TODO Renable when we don't write spans to snapshots. /* #[test] #[cfg(not(feature = "ci_skip"))]