def struct_variable_codeblocks(variable, policies, id, symbol_table, sub):
 name = ('V%i' % id)
 if (variable not in symbol_table):
  symbol_table[variable] = name
 sub = dict(sub)
 sub['id'] = id
 sub['fail'] = failure_code_init(sub)
 sub['py_ptr'] = ('py_%s' % name)
 sub['stor_ptr'] = ('storage_%s' % name)
 struct_builder = CodeBlock(*([apply_policy(policy, variable, name, sub) for policy in policies[0]] + [sub]))
 sub['id'] = (id + 1)
 sub['fail'] = failure_code(sub)
 sub['py_ptr'] = ('py_%s' % name)
 sub['stor_ptr'] = ('storage_%s' % name)
 block = CodeBlock(*([apply_policy(policy, variable, name, sub) for policy in policies[1]] + [sub]))
 return (struct_builder, block)

def struct_variable_codeblocks ( variable , policies , id , symbol_table , sub ) : name = ( 'V%i' % id ) if ( variable not in symbol_table ) : symbol_table [ variable ] = name sub = dict ( sub ) sub [ 'id' ] = id sub [ 'fail' ] = failure_code_init ( sub ) sub [ 'py_ptr' ] = ( 'py_%s' % name ) sub [ 'stor_ptr' ] = ( 'storage_%s' % name ) struct_builder = CodeBlock ( * ( [ apply_policy ( policy , variable , name , sub ) for policy in policies [ 0 ] ] + [ sub ] ) ) sub [ 'id' ] = ( id + 1 ) sub [ 'fail' ] = failure_code ( sub ) sub [ 'py_ptr' ] = ( 'py_%s' % name ) sub [ 'stor_ptr' ] = ( 'storage_%s' % name ) block = CodeBlock ( * ( [ apply_policy ( policy , variable , name , sub ) for policy in policies [ 1 ] ] + [ sub ] ) ) return ( struct_builder , block )
update "sub" dict and create two codeblocks with different failure modes parameters variable : a variable policies : a pair of tuples -- at construction .