support calling functions with no args in pseudocode
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 4 May 2023 04:25:42 +0000 (21:25 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 4 May 2023 04:25:42 +0000 (21:25 -0700)
src/openpower/decoder/pseudo/parser.py

index d8c0399e8ecdb8c8764955c9ae42fbb52f239346..de3eda732e7d16255a07b1758b143a005d828e0d 100644 (file)
@@ -786,8 +786,11 @@ class PowerParser:
         p[0] = p[1]
 
     def p_trailer_arglist(self, p):
-        "trailer_arglist : LPAR arglist RPAR"
-        p[0] = ("CALL", p[2])
+        """trailer_arglist : LPAR arglist RPAR
+                           | LPAR RPAR
+        """
+        args = [] if len(p) == 3 else p[2]
+        p[0] = ("CALL", args)
 
     def p_trailer_subscript(self, p):
         "trailer_subscript : LBRACK subscript RBRACK"