示例#1
0
文件: __main__.py 项目: mgpb/runa
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])
示例#2
0
文件: test.py 项目: pombredanne/runa
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()
示例#3
0
文件: test.py 项目: 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()
示例#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()]
示例#5
0
文件: test.py 项目: 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()]
示例#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)
示例#7
0
文件: __main__.py 项目: 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)