@@ -618,16 +618,6 @@ def visitField(self, field, name, sum=None, prod=None, depth=0):
618618 self .emit ("}" , depth )
619619
620620
621- class MarshalPrototypeVisitor (PickleVisitor ):
622-
623- def prototype (self , sum , name ):
624- ctype = get_c_type (name )
625- self .emit ("static int marshal_write_%s(PyObject **, int *, %s);"
626- % (name , ctype ), 0 )
627-
628- visitProduct = visitSum = prototype
629-
630-
631621class SequenceConstructorVisitor (EmitVisitor ):
632622 def visitModule (self , mod ):
633623 for dfn in mod .dfns :
@@ -1167,25 +1157,6 @@ def addObj(self, name):
11671157 self .emit ("Py_INCREF(state->%s_type);" % name , 1 )
11681158
11691159
1170- _SPECIALIZED_SEQUENCES = ('stmt' , 'expr' )
1171-
1172- def find_sequence (fields , doing_specialization ):
1173- """Return True if any field uses a sequence."""
1174- for f in fields :
1175- if f .seq :
1176- if not doing_specialization :
1177- return True
1178- if str (f .type ) not in _SPECIALIZED_SEQUENCES :
1179- return True
1180- return False
1181-
1182- def has_sequence (types , doing_specialization ):
1183- for t in types :
1184- if find_sequence (t .fields , doing_specialization ):
1185- return True
1186- return False
1187-
1188-
11891160class StaticVisitor (PickleVisitor ):
11901161 CODE = '''Very simple, always emit this static code. Override CODE'''
11911162
@@ -1283,18 +1254,6 @@ def emit(s, d):
12831254 emit ("goto failed;" , 1 )
12841255 emit ("Py_DECREF(value);" , 0 )
12851256
1286- def emitSeq (self , field , value , depth , emit ):
1287- emit ("seq = %s;" % value , 0 )
1288- emit ("n = asdl_seq_LEN(seq);" , 0 )
1289- emit ("value = PyList_New(n);" , 0 )
1290- emit ("if (!value) goto failed;" , 0 )
1291- emit ("for (i = 0; i < n; i++) {" , 0 )
1292- self .set ("value" , field , "asdl_seq_GET(seq, i)" , depth + 1 )
1293- emit ("if (!value1) goto failed;" , 1 )
1294- emit ("PyList_SET_ITEM(value, i, value1);" , 1 )
1295- emit ("value1 = NULL;" , 1 )
1296- emit ("}" , 0 )
1297-
12981257 def set (self , field , value , depth ):
12991258 if field .seq :
13001259 # XXX should really check for is_simple, but that requires a symbol table
@@ -1313,7 +1272,6 @@ def set(self, field, value, depth):
13131272 else :
13141273 self .emit ("value = ast2obj_list(state, (asdl_seq*)%s, ast2obj_%s);" % (value , field .type ), depth )
13151274 else :
1316- ctype = get_c_type (field .type )
13171275 self .emit ("value = ast2obj_%s(state, %s);" % (field .type , value ), depth , reflow = False )
13181276
13191277
0 commit comments