示例#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)
示例#2
0
def compose_from_str(src_str):
    """
    compose an AST from src_str
    """

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

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

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