mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 19:28:26 +08:00
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
Block a user