Example #1
0
def compose_all_from_str(src_str):
    """
    compose all AST from src_str
    """

    pgen = parse.parse(StringIO(src_str))
    return iter(partial(compose, pgen), None)
Example #2
0
def compose_from_str(src_str):
    """
    compose an AST from src_str
    """

    pgen = parse.parse(StringIO(src_str))
    return compose(pgen)
Example #3
0
def compose_all_from_stream(stream):
    """
    compose all AST from input stream
    """

    pgen = parse.parse(stream)
    return iter(partial(compose, pgen), None)
Example #4
0
def compose_from_stream(stream):
    """
    compose an AST from an input stream
    """

    pgen = parse.parse(stream)
    return compose(pgen)