forked from M-Labs/artiq
1
0
Fork 0

More friendly artiq.py2llvm.typing testbench.

This commit is contained in:
whitequark 2015-06-15 15:59:36 +03:00
parent 20e0e69358
commit a3789868f2
1 changed files with 3 additions and 2 deletions

View File

@ -916,13 +916,14 @@ def main():
else:
def process_diagnostic(diag):
print("\n".join(diag.render()))
if diag.level == 'fatal':
if diag.level in ('fatal', 'error'):
exit(1)
engine = diagnostic.Engine()
engine.process = process_diagnostic
buf = source.Buffer("".join(fileinput.input()), os.path.basename(fileinput.filename()))
buf = source.Buffer("".join(fileinput.input()).expandtabs(),
os.path.basename(fileinput.filename()))
parsed, comments = parse_buffer(buf, engine=engine)
typed = ASTTypedRewriter(engine=engine).visit(parsed)
Inferencer(engine=engine).visit(typed)