From 97b486096188a133e549f128416bc4338f68618d Mon Sep 17 00:00:00 2001 From: overflowerror Date: Thu, 7 Apr 2022 21:39:48 +0200 Subject: [PATCH] line count now includes quoted lines --- interpreter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/interpreter.js b/interpreter.js index 61dc9ab..9236f5e 100644 --- a/interpreter.js +++ b/interpreter.js @@ -237,7 +237,7 @@ } } - return astRoot; + return [astRoot, line]; } function parseCommands(content) { @@ -330,7 +330,8 @@ } const end = findSymbolInScope(content, line, '"', i + 1, length); - const ast = doubleQuoteToAst(content.substring(i + 1, end), line); + const [ast, _line] = doubleQuoteToAst(content.substring(i + 1, end), line); + line = _line; value.add(ast); @@ -383,7 +384,8 @@ } const end = findSymbolInScope(content, line, '"', i + 1, length); - const ast = doubleQuoteToAst(content.substring(i + 1, end), line); + const [ast, _line] = doubleQuoteToAst(content.substring(i + 1, end), line); + line = _line; value.add(ast);