#!/bin/node
// Very simple hack to test the code from node
//  sudo npm install -g acorn

var fs = require("fs");
var acorn = require("acorn");

var navigator = {
  userAgent : "X"
};      

var Espruino = eval(fs.readFileSync("espruino.js").toString());
eval(fs.readFileSync("core/utils.js").toString());
eval(fs.readFileSync("core/config.js").toString());
eval(fs.readFileSync("plugins/compiler.js").toString());
eval(fs.readFileSync("plugins/assembler.js").toString());

Espruino.Core.Notifications = console;
Espruino.Core.Env = {
  getBoardData : function() {
    return { EXPORT : ["jsvLock,jsvUnLock,jsvMathsOp,"+
      "jsvNewFromFloat,jsvNewFromInteger,jsvNewFromString,jsvNewFromBool,"+
      "jsvGetFloat,jsvGetInteger,jsvGetBool,"+
      "jspeiFindInScopes,jspReplaceWith,", 536871028] };
  }
};

Espruino.init();

Espruino.callProcessor("transformForEspruino",'console.log("Hello");\nfunction a(b) { "compiled";return b+"World"; }\nconsole.log("World")', function(code) {
  console.log(code);
});


@@ -590,16 +590,29 @@
 jsvLock,
+jsvLockAgain,
 jsvUnLoc
@@ -624,16 +624,36 @@
 MathsOp,
+jsvMathsOpSkipNames,
 %22+%0A     
@@ -904,28 +904,12 @@
 o%22,'
-console.log(%22Hello%22)
+x=42
 ;%5Cnf
@@ -920,11 +920,10 @@
 ion 
-a(b
+f(
 ) %7B 
@@ -944,42 +944,12 @@
 urn 
-b+%22World%22; %7D%5Cnconsole.log(%22World%22)
+1; %7D
 ', f

add jsvLockAgain