Converted everything to use acorn npm package. Updated acorn packages to latest version. Updated acorn parsing to use ES9

This commit is contained in:
danielyxie
2019-07-13 22:36:12 -07:00
committed by danielyxie
parent 042f926700
commit 91ee65a101
9 changed files with 19 additions and 3667 deletions
+2 -2
View File
@@ -6,11 +6,11 @@
* the way
*/
import * as walk from "acorn-walk";
import { parse, Node } from "acorn";
import { RamCalculationErrorCode } from "./RamCalculationErrorCodes";
import { RamCosts, RamCostConstants } from "../Netscript/RamCostGenerator";
import { parse, Node } from "../../utils/acorn";
// These special strings are used to reference the presence of a given logical
// construct within a user script.
@@ -215,7 +215,7 @@ async function parseOnlyRamCalculate(otherScripts, code, workerScript) {
* that need to be parsed (i.e. are 'import'ed scripts).
*/
function parseOnlyCalculateDeps(code, currentModule) {
const ast = parse(code, {sourceType:"module", ecmaVersion: 8});
const ast = parse(code, {sourceType:"module", ecmaVersion: 9});
// Everything from the global scope goes in ".". Everything else goes in ".function", where only
// the outermost layer of functions counts.