parser: Allow an empty goal statement with no targets, deps or code.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 10 Jan 2020 12:30:51 +0000 (12:30 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 10 Jan 2020 12:31:31 +0000 (12:31 +0000)
This allows you to write "do nothing" goals like:

  goal all ;

src/parser.mly

index eedbddb..9d6988b 100644 (file)
@@ -118,6 +118,10 @@ stmt:
       let name, params = $1 in
       name, Ast.EGoalDefn ($loc, (params, [], [], Some $2))
     }
+    | GOAL ID
+    {
+      $2, Ast.EGoalDefn ($loc, ([], [], [], None))
+    }
     | option(PURE) FUNCTION ID params_decl return_decl EQUALS CODE
     {
       $3, Ast.EFuncDefn ($loc, ($4, $5, $1 <> None, $7))