Exemplo n.º 1
0
def t2(s, a=None):
    o = parser.parse_macro_file(s)
    r = repr(o)
    print "%r => %s" % (s, r)
    if A and a:
        assert r == a, "\n%s\n!=\n%s\n" % (r, a)
    return o
Exemplo n.º 2
0
def load():
    ctx = parser_types.Context()
    for pat in default_files:
        files = glob.glob(pat)
        for file in files:
            try:
                mf = parser.parse_macro_file(open(file).read())
                mf.eval(ctx)
            except parser.ParserError, e:
                raise LoadError, "failed to parse %s" % file