From: Richard W.M. Jones Date: Fri, 10 Jan 2020 12:30:51 +0000 (+0000) Subject: parser: Allow an empty goal statement with no targets, deps or code. X-Git-Tag: v'0.2'~47 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=017d19bf31e5e4d15423fe7c8068b50034b919a3;p=goals.git parser: Allow an empty goal statement with no targets, deps or code. This allows you to write "do nothing" goals like: goal all ; --- diff --git a/src/parser.mly b/src/parser.mly index eedbddb..9d6988b 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -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))