Skip to content

Commit

Permalink
chore: better arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
P403n1x87 committed Oct 1, 2023
1 parent 3402b96 commit 38c1212
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spasm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def dump_code_to_file(code: CodeType, file: Path) -> None:
stream.flush()


def assemble(source: str, filename: str) -> CodeType:
asm = Assembly(name="<module>", filename=filename, lineno=1)
asm.parse(source)
def assemble(sourcefile: Path) -> CodeType:
asm = Assembly(name="<module>", filename=str(sourcefile.resolve()), lineno=1)
asm.parse(sourcefile.read_text())
return asm.compile()


Expand All @@ -47,7 +47,7 @@ def main() -> None:

try:
dump_code_to_file(
assemble(args.file.read_text(), str(args.file.resolve())),
assemble(args.file),
args.file.with_suffix(".pyc"),
)
except Exception as e:
Expand Down

0 comments on commit 38c1212

Please sign in to comment.