def setup_class(self): self.parser = get_parser() self.lexer = get_lexer() self.space = Space() self.space.setup_builtins(*default_builtins(self.space)) self.interpreter = Interpreter() self.space.setup(self.interpreter)
def setup_class(self): self.parser = get_parser() self.lexer = get_lexer() self.space = Space() builtins, core_mods, not_builtins = default_builtins(self.space) builtins.append(magic_log) self.space.setup_builtins(builtins, core_mods, not_builtins) self.space.log = [] self.interpreter = Interpreter() self.space.setup(self.interpreter)
def setup_class(self): self.parser = get_parser() self.lexer = get_lexer()
i = p.rfind('/') + 1 assert i >= 0 head, tail = p[:i], p[i:] if head and head != '/' * len(head): head = head.rstrip('/') return head, tail def main(argv): if len(argv) != 2: print __doc__ return 1 return run_code(argv[1]) parser = get_parser() lexer = get_lexer() space = Space() space.setup_builtins(*default_builtins(space)) def format_parser_error(pe): print "Error parsing input file %s, line %d: %s" % (pe.filename, pe.lineno, pe.msg) print " " + pe.line print " " + " " * pe.start_colno + "^" * (pe.end_colno - pe.start_colno) def parse_name(fname): name = path_split(fname)[-1] p = name.rfind(".")