From 9fa301a7cf8e8b5883521d1a966ee7b65ecf925e Mon Sep 17 00:00:00 2001 From: sanine-a Date: Mon, 22 May 2023 15:09:10 -0500 Subject: fix comment parsing --- src/parser/parser.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/parser/parser.js') diff --git a/src/parser/parser.js b/src/parser/parser.js index 7d3dd95..8672832 100644 --- a/src/parser/parser.js +++ b/src/parser/parser.js @@ -36,15 +36,16 @@ parser.yy = { //if (process.argv[1] === 'parser.js' && process.argv.length >= 3) { fs.readFile(process.argv[2], 'utf8', (err, data) => { if (err) throw err; - let program = parser.parse(data.toUpperCase()); - if (typeof(program.start) === "string") { - program.start = parser.yy.line[program.start]; + let result = parser.parse(data.toUpperCase()); + if (typeof(result.start) === "string") { + result.start = parser.yy.line[result.start]; } - for (let pc=0; pc