def macroBufFeed( self, l, outer= True): ensure( l, [Cons]) if outer: if isinstance( l.cdr(), Cons): if isinstance( l.cdr().car(), Cons): ensureConsType( l.cdr().car(), ar_codeList) # baustelle: ggf. uebertestet ensureConsType( l.cdr().car().cdr().car(), ar_codeListConfig) # baustelle: ggf. uebertestet pass uNames.next( usRename( ConsSimple, 'cs')) uNames.next( usRename( Symbol, 's')) c= l r= nil # reverse while not id( nil) == id( c): r= ConsSimple( c.car(), r) c= c.cdr() self.macroBufAdd( False, Symbol( ')')) while not id( nil) == id( r): value= r.car() if isinstance( value, Cons) and typeSymbolChk( value.car(), ar_codeList): # f69eef8ad76e459da16194dcdd0c73c6 codeListEnsure( value) # b73fcfe5b4de4df6946ee586d8f79713 self.macroBufFeed( codeListGetParameterValues( value), outer= False) # 2849da4969b146bc88315f20fd205e06 baustelle0: hier wird das Environment verworfen else: self.macroBufAdd( False, value) r= r.cdr() self.macroBufAdd( outer, Symbol( '(')) # 64005373aae94f3a9314d303d5f4016e uNames.undo() uNames.undo()
def macroBufFeed_v2( self, l): # macroBufFeed if isinstance( l, Cons) and typeSymbolChk( l.car(), ar_codeList): # f69eef8ad76e459da16194dcdd0c73c6 codeListEnsure( l) # b73fcfe5b4de4df6946ee586d8f79713 return self.macroBufFeed( codeListGetParameterValues( l)) # 2849da4969b146bc88315f20fd205e06 baustelle0: hier wird das Environment verworfen else: return self.macroBufAdd( True, l)
def testSymbols3(): te.checkComplainAndAdjustExpected( 0) s1= Symbol( 's1') s2= Symbol( 's2') s3= Symbol( 's3') s4= Symbol( 's4') s5= Symbol( 's5') typeSymbol.symAdd( s2, [s1]) typeSymbol.symAdd( s3, [s2]) typeSymbol.symAdd( s4, [s3]) typeSymbol.symAdd( s5, [s4]) te.test( typeSymbolChk( s5, s1)) typeSymbolNot.symAdd( s4, [s2]) te.test( not typeSymbolChk( s5, s1)) te.test( not typeSymbolChk( s5, s2)) te.test( typeSymbolChk( s5, s3)) te.test( typeSymbolChk( s5, s4)) te.test( not typeSymbolChk( s4, s1)) te.test( not typeSymbolChk( s4, s2)) te.test( typeSymbolChk( s4, s3)) te.test( typeSymbolChk( s3, s1)) te.test( typeSymbolChk( s3, s2)) te.test( typeSymbolChk( s2, s1)) typeSymbol.symDel( s5) typeSymbol.symDel( s4) typeSymbol.symDel( s3) typeSymbol.symDel( s2) typeSymbolNot.symDel( s4) te.checkComplainAndAdjustExpected( 11)
def testSymbols1(): # 010407a6a37b49bfb9836e84236e5586 te.checkComplainAndAdjustExpected( 0) s1= Symbol( 's1') s2= Symbol( 's2') s3= Symbol( 's3') s4= Symbol( 's4') te.test( not typeSymbolChk( s4, Symbol( 's4'))) te.test( typeSymbolChk( s4, s4)) te.test( typeSymbolChk( s1, s1)) typeSymbol.symAdd( s2, [s1]) typeSymbol.symAdd( s3, [s1]) typeSymbol.symAdd( s4, [s2, s3]) te.test( typeSymbolChk( s4, s3)) te.test( typeSymbolChk( s4, s2)) te.test( typeSymbolChk( s4, s1)) te.test( typeSymbolChk( s3, s1)) te.test( typeSymbolChk( s2, s1)) typeSymbolNot.symAdd( s3, [s1]) te.test( typeSymbolChk( s4, s3)) te.test( typeSymbolChk( s4, s2)) te.test( typeSymbolChk( s4, s1)) te.test( not typeSymbolChk( s3, s1)) te.test( typeSymbolChk( s2, s1)) typeSymbolNot.symAdd( s2, [s1]) te.test( typeSymbolChk( s4, s3)) te.test( typeSymbolChk( s4, s2)) te.test( not typeSymbolChk( s4, s1)) te.test( not typeSymbolChk( s3, s1)) te.test( not typeSymbolChk( s2, s1)) typeSymbolNot.symAdd( s4, [s3,s2]) te.test( not typeSymbolChk( s4, s3)) te.test( not typeSymbolChk( s4, s2)) te.test( not typeSymbolChk( s4, s1)) te.test( not typeSymbolChk( s3, s1)) te.test( not typeSymbolChk( s2, s1)) typeSymbolNot.symDel( s3) te.test( not typeSymbolChk( s4, s3)) te.test( not typeSymbolChk( s4, s2)) te.test( not typeSymbolChk( s4, s1)) te.test( typeSymbolChk( s3, s1)) te.test( not typeSymbolChk( s2, s1)) typeSymbolNot.symDel( s2) te.test( not typeSymbolChk( s4, s3)) te.test( not typeSymbolChk( s4, s2)) te.test( not typeSymbolChk( s4, s1)) te.test( typeSymbolChk( s3, s1)) te.test( typeSymbolChk( s2, s1)) typeSymbolNot.symDel( s4) for i in ( s4, s3, s2): typeSymbol.symDel( i) te.checkComplainAndAdjustExpected( 33)