nand2tetris/compiler/__init__.py

14 lines
297 B
Python
Raw Normal View History

from engine import Engine
2020-06-15 20:35:33 +00:00
import sys
from pathlib import Path
if __name__ == '__main__':
p = Path(sys.argv[1])
if p.is_dir():
for f in p.glob("*.jack"):
print("compiling %s" % f)
Engine(f.as_posix()).compileClass()
elif p.is_file():
Engine(p.as_posix()).compileClass()
2020-06-15 20:35:33 +00:00