Skip to content

Commit

Permalink
update expression -> assignop statment changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0mz committed Apr 30, 2024
1 parent 8f85c50 commit 822a9de
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 34 deletions.
2 changes: 1 addition & 1 deletion test/cram/function-declarations.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const f;
f = function (x, y, z) {
const v1;
v1 = x++;
v1 = x + 1;
v1;
}

Expand Down
29 changes: 4 additions & 25 deletions test/cram/template-expressions.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,7 @@
temp = `head template ${v1} end tail`;

$ dune exec ast_gen -f input-code-5.js
const tag;
tag = function (strings, personExp, ageExp) {
let ageStr;
const v1;
v1 = ageExp > 99;
ageStr = (v1) ? 'centenarian' : 'youngster';
const v2;
v2 = strings[0];
const v3;
v3 = strings[1];
const v4;
v4 = strings[2];
return `${v2}${personExp}${v3}${ageStr}${v4}`;
}
const firstName;
firstName = 'Mike';
const lastName;
lastName = 'Wheeler';
const age;
age = 28;
const output;
const v5;
v5 = firstName + lastName;
output = tag`${v5} is a ${age}.`;

ast_gen: internal error, uncaught exception:
Failure("Unknown expression type to normalize (object on (9, 15) to (9, 60))")

[125]
4 changes: 2 additions & 2 deletions test/cram/unary-expressions.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const x;
x = 0;
const v1;
v1 = x++;
v1 = x + 1;
v1;

$ dune exec ast_gen -f input-code-3.js
Expand All @@ -16,7 +16,7 @@
const v1;
v1 = x.y;
const v2;
v2 = v1++;
v2 = v1 + 1;
v2;
const v3;
v3 = x.y;
Expand Down
10 changes: 5 additions & 5 deletions test/cram/while-statements.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
v1 = x < 1;
while (v1) {
const v2;
v2 = x++;
v2 = x + 1;
v2;
v1 = x < 1;
}
Expand All @@ -24,7 +24,7 @@
v1 = true;
while (v1) {
const v2;
v2 = x++;
v2 = x + 1;
v2;
v1 = x < 1;
}
Expand All @@ -36,7 +36,7 @@
v1 = true;
while (v1) {
const v2;
v2 = x++;
v2 = x + 1;
v2;
break;
v1 = x < 1;
Expand All @@ -52,7 +52,7 @@
v3 = alert(i);
v3;
const v2;
v2 = ++i;
v2 = i + 1;
v1 = i < 10;
}

Expand All @@ -66,7 +66,7 @@
v3 = alert(i);
v3;
const v2;
v2 = ++i;
v2 = i + 1;
v1 = i < 10;
}

2 changes: 1 addition & 1 deletion test/cram/yield-expressions.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const foo;
foo = function (index) {
const v1;
v1 = index++;
v1 = index + 1;
yield v1;
}

0 comments on commit 822a9de

Please sign in to comment.