Simplify list construction
authorDavid Kerkeslager <kerkeslager@gmail.com>
Wed, 28 Aug 2019 15:54:01 +0000 (11:54 -0400)
committerDavid Kerkeslager <kerkeslager@gmail.com>
Wed, 28 Aug 2019 15:54:01 +0000 (11:54 -0400)
normalization.py

index 76c5395..309e84c 100644 (file)
@@ -162,8 +162,6 @@ def normalize_list_literal_expression(counter, expression):
 
     prestatements = []
 
-    list_expression = NormalVariableExpression(variable=list_variable)
-
     for item_expression in expression.item_expression_list:
         counter, item_expression_prestatements, normalized = normalize_expression(
             counter,
@@ -179,15 +177,10 @@ def normalize_list_literal_expression(counter, expression):
             )
         )
 
-    prestatements.append(NormalVariableInitializationStatement(
-        variable=list_variable,
-        expression=NormalListConstructExpression(allocate=len(expression.item_expression_list)),
-    ))
-
     return (
         counter,
         tuple(prestatements),
-        list_expression,
+        NormalListConstructExpression(allocate=len(expression.item_expression_list)),
     )
 
 def normalize_string_literal_expression(counter, expression):