Exemplo n.º 1
0
def entry_point(argv):
    if len(argv) == 2:
        runtime = get_runtime()
        code = open_file_as_stream(argv[1]).readall()
        try:
            runtime.execute(code)
        except BacktrackException, e:
            (line, col) = e.error.get_line_column(code)
            print "parse error in line %d, column %d" % (line, col)
            return 1
        except QuoppaException as e:
            os.write(1, "%s\n" % str(e))
            os.write(1, "%s\n" % str(e.msg))
            return 1
Exemplo n.º 2
0
 def setup_method(self, obj):
     self.r = get_runtime()