Skip to content

Commit

Permalink
Inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
icmor committed Oct 31, 2024
1 parent 262af35 commit 2b7f8be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ def assemble(code: list[str]) -> list[str]:
real_lineno = 0
lineno = 0
for line in code:
line = line.strip()
line = line.partition("//")[0].strip() # allow for inline comments
real_lineno += 1
if line.startswith("//") or line == "":
if not line:
continue
if line.startswith("("): # label
label = parse_label(line, real_lineno)
Expand Down

0 comments on commit 2b7f8be

Please sign in to comment.