Something went wrong. Try again.
OR-1 dataflow CPU sketch
Something went wrong. Try again.
539 B · 19 lines
Python
at main
1234567891011121314151617181920"""Shared test helper functions for the OR1 assembler test suite."""
from textwrap import dedent
from asm.lower import lowerfrom asm.resolve import resolve
def parse_and_lower(parser, source: str): """Parse source code and lower the resulting CST to IRGraph.""" tree = parser.parse(dedent(source)) return lower(tree)
def parse_lower_resolve(parser, source: str): """Parse source code, lower to IRGraph, then resolve names.""" tree = parser.parse(dedent(source)) graph = lower(tree) return resolve(graph)