Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsol committed Jul 26, 2020
1 parent f962f83 commit 15c7348
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 155 deletions.
16 changes: 8 additions & 8 deletions .gitignore
@@ -1,12 +1,12 @@
pyxell
*.exe
*.jar
.idea/
*.iml
_*
*.tmp
build/
dist/
env/
*.cpp
*.exe
*.gch
*.iml
*.jar
*.spec
build/
dist/
*.tmp
_*
8 changes: 4 additions & 4 deletions src/main.py
Expand Up @@ -9,10 +9,10 @@
from pathlib import Path
from timeit import default_timer as timer

from .compiler import PyxellCompiler
from .errors import NotSupportedError, PyxellError
from .indentation import transform_indented_code
from .parsing import parse_program
from .transpiler import PyxellTranspiler
from .version import __version__

abspath = Path(__file__).parents[1]
Expand Down Expand Up @@ -92,13 +92,13 @@ def compile(filepath, cpp_compiler, opt_level, verbose=False, mode='executable')
print(f"transpiling {filepath} to {cpp_filename}")

t1 = timer()
compiler = PyxellCompiler(cpp_compiler)
transpiler = PyxellTranspiler(cpp_compiler)

for name, ast in units.items():
compiler.run(ast, name)
transpiler.run(ast, name)

ast = build_ast(filepath)
code = compiler.run_main(ast)
code = transpiler.run_main(ast)

with open(cpp_filename, 'w') as file:
file.write(f"/*\n"
Expand Down

0 comments on commit 15c7348

Please sign in to comment.