bbscript/runtime.py
def exec_line(self, line):
		"""Executes a single line of bbscript"""
		# assert line is an array
		if not isinstance(line, list):
			raise SyntaxError("BBScript blocks may only contain arrays.")

		# Test line, should either be a statement or a code block
		if isinstance(line[0], str):
			# we have a statement
			result = self.resolve_statement(line)

			if isinstance(result, RepeatStatement):
				# repeat line if script deems statement not fullfilled
				self.script = [line] + self.script
			elif isinstance(result, list) and len(result) > 0 and isinstance(result[0], list):
				# if we have another block, inject individual statements on script
				# usually this would be the case on IF statements returning the
				# next block to execute for example.
				self.script = result + self.script
			else:
				return result

		elif isinstance(line[0], list):
			# inject entire blocks into script to resolve inlined blocks
			self.script = line + self.script
Executes a single line of bbscript
Executes a single line of bbscript
Executes a single line of bbscript
def exec_line(self, line):
		if not isinstance(line, list):
			raise SyntaxError("BBScript blocks may only contain arrays.")
		if isinstance(line[0], str):
			result = self.resolve_statement(line)
			if isinstance(result, RepeatStatement):
				self.script = [line] + self.script
			elif isinstance(result, list) and len(result) > 0 and isinstance(result[0], list):
				self.script = result + self.script
			else:
				return result
		elif isinstance(line[0], list):
			self.script = line + self.script
def exec_line ( self , line ) : if not isinstance ( line , list ) : raise SyntaxError ( "BBScript blocks may only contain arrays." ) if isinstance ( line [ 0 ] , str ) : result = self . resolve_statement ( line ) if isinstance ( result , RepeatStatement ) : self . script = [ line ] + self . script elif isinstance ( result , list ) and len ( result ) > 0 and isinstance ( result [ 0 ] , list ) : self . script = result + self . script else : return result elif isinstance ( line [ 0 ] , list ) : self . script = line + self . script
Executes a single line of bbscript
Executes a single line of bbscript
"""Executes a single line of bbscript""" # assert line is an array # Test line, should either be a statement or a code block # we have a statement # repeat line if script deems statement not fullfilled # if we have another block, inject individual statements on script # usually this would be the case on IF statements returning the # next block to execute for example. # inject entire blocks into script to resolve inlined blocks
self
line