Example #1
0
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])
Example #2
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()
Example #3
0
File: test.py Project: mgpb/runa
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()
Example #4
0
 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()]
Example #5
0
File: test.py Project: djc/runa
	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()]
Example #6
0
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)
Example #7
0
File: __main__.py Project: djc/runa
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)