@@ -324,7 +324,11 @@ def _TestlistComp(self, parent, p_node, id0):
324
324
325
325
n = p_node .NumChildren ()
326
326
if n > 1 and p_node .GetChild (1 ).typ == grammar_nt .comp_for :
327
- elt = self .Expr (p_node .GetChild (0 ))
327
+ child0 = p_node .GetChild (0 )
328
+ if child0 .typ == grammar_nt .splat_expr :
329
+ p_die ('Splat not currently supported' , child0 .tok )
330
+ elt = self .Expr (child0 )
331
+
328
332
comp = self ._CompFor (p_node .GetChild (1 ))
329
333
if id0 == Id .Op_LParen : # (x+1 for x in y)
330
334
return expr .GeneratorExp (elt , [comp ])
@@ -346,7 +350,10 @@ def _TestlistComp(self, parent, p_node, id0):
346
350
if id0 == Id .Op_LBracket : # List [1,2,3]
347
351
elts = [] # type: List[expr_t]
348
352
for i in xrange (0 , n , 2 ): # skip commas
349
- elts .append (self .Expr (p_node .GetChild (i )))
353
+ child = p_node .GetChild (i )
354
+ if child .typ == grammar_nt .splat_expr :
355
+ p_die ('Splat not currently supported' , child .tok )
356
+ elts .append (self .Expr (child ))
350
357
351
358
return expr .List (parent .tok , elts ,
352
359
expr_context_e .Store ) # unused expr_context_e
0 commit comments