Basic GS2 Emulator V1.1

The emulator simply converts the script to compatible JavaScript and evaluates it. There's enough emulated to go through the first 5 parts of my tutorial and the first challenge.

Notes:
This isn't (and will likely never be) a perfect emulation of GS2, scripts may work differently in an actual GS2 environment.
Concatenation symbols (@, SPC, NL, TAB) are replaced with their javascript equivalent.
All variables are global so the temp prefix will not work the same way as it does in GS2.
GS2 Arrays are currently not supported. GS2 Arrays (up to two dimensions) are properly converted now. Thanks Jazz!
GS2's For Each is converted now but the following won't work for (a: {1,2,3}) echo(a); however for (a: {1,2,3}) { echo(a) } will.

Script


Output