def compile(fn, opts): '''Compile the given program to a binary of the same name''' ir = runac.ir(fn) if opts.outfile: runac.compile(ir, opts.outfile) else: runac.compile(ir, os.path.basename(fn).rsplit('.rns')[0])
def compile(fn, bin): try: runac.compile(fn, bin) return None except util.Error as e: return e.show() except util.ParseError as e: return e.show()
def compile(src, bin): try: runac.compile(runac.ir(src), bin) return None except util.Error as e: return e.show() except util.ParseError as e: return e.show()
def compile(self): if self.opts.get('type', 'test') == 'show': return [0, '\n'.join(runac.show(self.fn, None)) + '\n', bytes()] try: runac.compile(self.fn, self.bin) return [0, bytes(), bytes()] except util.Error as e: return [0, bytes(), e.show()] except util.ParseError as e: return [0, bytes(), e.show()]
def compile(fn, opts): '''Compile the given program to a binary of the same name''' outfn = os.path.basename(fn).rsplit('.rns')[0] runac.compile(fn, outfn if opts.outfile is None else opts.outfile)