Scanner rework. (#3038)

The scanner was an on-demand tool of the parser, which was triggered by certain
statements. After the rework, the scanner runs only once, and collects all information.
This information is passed to the parser.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-09-11 11:15:46 +02:00
committed by Dániel Bátyai
parent 6221b670d1
commit fbde788d1f
24 changed files with 2511 additions and 1471 deletions
+8
View File
@@ -125,6 +125,13 @@ default:
func = () =>
((([0,0,0])))
assert (func ().length == 3);
func = (a = 5, b = 7 * 2) => a + b;
assert (func() == 19);
assert (func(1) == 15);
func = (a = Math.cos(0)) => a;
assert (func() == 1);
}
must_throw ("var x => x;");
@@ -136,6 +143,7 @@ must_throw ("(x,y,) => 0");
must_throw ("x\n => 0");
must_throw ("this => 0");
must_throw ("(true) => 0");
must_throw ("()\n=>5");
must_throw_strict ("(package) => 0");
must_throw_strict ("(package) => { return 5 }");
must_throw_strict ("(x,x,x) => 0");
+3
View File
@@ -39,3 +39,6 @@ assert (x === 42);
assert (f(1) === 1);
var dog = new Dog("Pluto")
assert(dog.speak() === "Pluto barks.")
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -18,3 +18,6 @@ export {aa,} from "module-export-01.js";
export {bb as b_, cc as c_} from "module-export-01.js";
export * from "module-export-01.js";
export default function () {return "default"};
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -24,3 +24,6 @@ export default class {
}
export * from "module-export-02.js"
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -15,3 +15,6 @@
export var x = 41
export default a = "str"
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -16,3 +16,6 @@
export * from "module-export-01.js";
export * from "module-export-04.js";
export default a = "str"
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -17,3 +17,6 @@ export {}
export {} from "module-export-01.js";
export {};
export {} from "module-export-04.js"
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -15,3 +15,6 @@
var y, z;
export default x = y = z = "default";
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -31,3 +31,6 @@ assert (mod.f("str") === "str")
var dog = new mod.Dog("Oddie")
assert (dog.speak() === "Oddie barks.")
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -22,3 +22,6 @@ assert (b_ === 5)
assert (c_(b_) === 10)
assert (mod.x === 42)
assert (Array.isArray(mod.d))
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -22,3 +22,6 @@ assert(i.incr() === 6);
assert (aa === "a");
assert (x === 42);
assert (c_(x) == 84);
// Pre-scanner regression test
for (var tmp in {}) ;
+3
View File
@@ -17,3 +17,6 @@ import "module-import-01.js";
import "module-export-05.js";
import "module-export-06.js";
import "module-export-07.js";
// Pre-scanner regression test
for (var tmp in {}) ;
+1 -1
View File
@@ -14,7 +14,7 @@
var src = "var a = 0; while(a) { switch(a) {";
/* The += operation has a longer opcode. */
for (var i = 0; i < 4000; i++)
for (var i = 0; i < 3500; i++)
src += "case " + i + ": a += a += a; break; ";
src += "} }";