Commits

Andrey Lesnikov committed 183e2c8

Removed '[]' as default arg value

  • Participants
  • Parent commits 24e834d

Comments (0)

Files changed (4)

 
 
 class NodeFunctionInterface(BaseNode):
-    def __init__(self, parameter_list=[], return_type=None):
+    def __init__(self, parameter_list, return_type=None):
         self.parameter_list = parameter_list
         self.return_type = return_type
 
 
 
 class NodeFunctionCall(BaseNode):
-    def __init__(self, expression, argument_list=[]):
+    def __init__(self, expression, argument_list):
         self.expression = expression
         self.argument_list = argument_list
 

File test_generator.py

             declaration_sequence=[
                 ast.NodeFunctionDeclaration(
                     name='f1',
-                    interface=ast.NodeFunctionInterface(),
+                    interface=ast.NodeFunctionInterface(parameter_list=[]),
                     body=[
                         ast.NodeVariableDeclaration(
                             expression=ast.NodeFunctionCall(
                 ),
                 ast.NodeFunctionDeclaration(
                     name='f2',
-                    interface=ast.NodeFunctionInterface(),
+                    interface=ast.NodeFunctionInterface(parameter_list=[]),
                     body=[
                         ast.NodeVariableDeclaration(
                             expression=ast.NodeFunctionCall(
                 ),
                 ast.NodeFunctionDeclaration(
                     name='main',
-                    interface=ast.NodeFunctionInterface(),
+                    interface=ast.NodeFunctionInterface(parameter_list=[]),
                     body=[],
                 ),
             ]

File test_my_parser.py

         declaration_sequence=[
             ast.NodeFunctionDeclaration(
                 name='fname',
-                interface=ast.NodeFunctionInterface(),
+                interface=ast.NodeFunctionInterface(parameter_list=[]),
                 body=[],
             )
         ]
             declaration_sequence=[
                 ast.NodeFunctionDeclaration(
                     name='testfunc2',
-                    interface=ast.NodeFunctionInterface(),
+                    interface=ast.NodeFunctionInterface(parameter_list=[]),
                     body=[],
                 )
             ]
                 ast.NodeFunctionDeclaration(
                     name='testfunc2',
                     interface=ast.NodeFunctionInterface(
+                        parameter_list=[],
                         return_type=ast.NodeIdentifier('Integer'),
                     ),
                     body=[],
             ast.NodeReturn(
                 expression=ast.NodeFunctionCall(
                     expression=ast.NodeIdentifier('x'),
+                    argument_list=[],
                 ),
             ),
         )

File test_table.py

             declaration_sequence=[
                 ast.NodeFunctionDeclaration(
                     name='f1',
-                    interface=ast.NodeFunctionInterface(),
+                    interface=ast.NodeFunctionInterface(parameter_list=[]),
                     body=[
                         ast.NodeVariableDeclaration(
                             expression=ast.NodeNumber(1),
             declaration_sequence=[
                 ast.NodeFunctionDeclaration(
                     name='main',
-                    interface=ast.NodeFunctionInterface(),
+                    interface=ast.NodeFunctionInterface(parameter_list=[]),
                     body=[
                         ast.NodeFunctionCall(
                             expression=ast.NodeIdentifier('plus'),
             declaration_sequence=[
                 ast.NodeFunctionDeclaration(
                     name='main',
-                    interface=ast.NodeFunctionInterface(),
+                    interface=ast.NodeFunctionInterface(parameter_list=[]),
                     body=[
                         ast.NodeIf(
                             condition=ast.NodeNumber(1),