Skip to content

Commit

Permalink
Fix handling comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuth committed Jan 16, 2024
1 parent 96f21c4 commit 50135ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 50135ec

Please sign in to comment.