From 585b75ae4ee77f24a5f28bb7591c5ab81749d2bf Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Fri, 19 Jul 2019 21:07:53 -0700 Subject: [PATCH] Inline readUInt32LE This will allow us to do signed ints in some places but not all. --- experiments/modern/src/maki-interpreter/parser.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/experiments/modern/src/maki-interpreter/parser.js b/experiments/modern/src/maki-interpreter/parser.js index e05bed37..5623e0dc 100644 --- a/experiments/modern/src/maki-interpreter/parser.js +++ b/experiments/modern/src/maki-interpreter/parser.js @@ -234,26 +234,25 @@ function parseComand({ start, makiFile, length, pos, localFunctions }) { return command; } - const argValue = makiFile.readUInt32LE(); const argType = command.command.arg; let arg = null; switch (argType) { case "var": { - arg = argValue; + arg = makiFile.readUInt32LE(); break; } case "line": { - arg = argValue + 5 + pos; + arg = makiFile.readUInt32LE() + 5 + pos; break; } case "objFunc": { // TODO: ClassesOffset - arg = argValue; + arg = makiFile.readUInt32LE(); break; } case "func": { // Note in the perl code here: "todo, something strange going on here..." - const variable = argValue + 5; + const variable = makiFile.readUInt32LE() + 5; const offset = variable + pos; arg = { name: `func${offset}`, @@ -270,7 +269,7 @@ function parseComand({ start, makiFile, length, pos, localFunctions }) { } case "obj": { // Classes Offset - arg = argValue; + arg = makiFile.readUInt32LE(); break; } default: