forked from M-Labs/artiq
More friendly artiq.py2llvm.typing testbench.
This commit is contained in:
parent
20e0e69358
commit
a3789868f2
|
@ -916,13 +916,14 @@ def main():
|
||||||
else:
|
else:
|
||||||
def process_diagnostic(diag):
|
def process_diagnostic(diag):
|
||||||
print("\n".join(diag.render()))
|
print("\n".join(diag.render()))
|
||||||
if diag.level == 'fatal':
|
if diag.level in ('fatal', 'error'):
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
engine = diagnostic.Engine()
|
engine = diagnostic.Engine()
|
||||||
engine.process = process_diagnostic
|
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)
|
parsed, comments = parse_buffer(buf, engine=engine)
|
||||||
typed = ASTTypedRewriter(engine=engine).visit(parsed)
|
typed = ASTTypedRewriter(engine=engine).visit(parsed)
|
||||||
Inferencer(engine=engine).visit(typed)
|
Inferencer(engine=engine).visit(typed)
|
||||||
|
|
Loading…
Reference in New Issue