From 50135ec602ecdd8239a0e740e5f3e662103c1919 Mon Sep 17 00:00:00 2001 From: Andrew Huth Date: Mon, 15 Jan 2024 20:32:12 -0500 Subject: [PATCH] Fix handling comments --- src/cpu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu.ts b/src/cpu.ts index acc08f8..969a582 100644 --- a/src/cpu.ts +++ b/src/cpu.ts @@ -25,7 +25,7 @@ export function parse(code: string): Instruction[] { const output: Instruction[] = []; for (const line of lines) { - const trimmed = line.replace('#.+$', '').trim(); + const trimmed = line.replace(/#.+$/, '').trim(); if (!trimmed) continue;