git.annexia.org
/
goals.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
parser: Allow an empty goal statement with no targets, deps or code.
[goals.git]
/
src
/
parser.mly
diff --git
a/src/parser.mly
b/src/parser.mly
index
c59a555
..
9d6988b
100644
(file)
--- a/
src/parser.mly
+++ b/
src/parser.mly
@@
-38,7
+38,7
@@
let find_on_include_path filename =
let path = inc // filename in
if Sys.file_exists path then path else loop incs
in
let path = inc // filename in
if Sys.file_exists path then path else loop incs
in
- loop
Cmdline.includes
+ loop
(Cmdline.includes ())
)
let do_include env loc filename optflag file =
)
let do_include env loc filename optflag file =
@@
-60,7
+60,7
@@
let do_include env loc filename optflag file =
%}
(* Tokens. *)
%}
(* Tokens. *)
-%token <Ast.
substs
> CODE
+%token <Ast.
code
> CODE
%token COLON
%token COMMA
%token EQUALS
%token COLON
%token COMMA
%token EQUALS
@@
-74,6
+74,7
@@
let do_include env loc filename optflag file =
%token LEFT_PAREN
%token LET
%token OPTINCLUDE
%token LEFT_PAREN
%token LET
%token OPTINCLUDE
+%token PURE
%token RETURNING
%token RIGHT_ARRAY
%token RIGHT_PAREN
%token RETURNING
%token RIGHT_ARRAY
%token RIGHT_PAREN
@@
-117,9
+118,13
@@
stmt:
let name, params = $1 in
name, Ast.EGoalDefn ($loc, (params, [], [], Some $2))
}
let name, params = $1 in
name, Ast.EGoalDefn ($loc, (params, [], [], Some $2))
}
- |
FUNCTION ID params_decl return_decl EQUALS CODE
+ |
GOAL ID
{
{
- $2, Ast.EFuncDefn ($loc, ($3, $4, $6))
+ $2, Ast.EGoalDefn ($loc, ([], [], [], None))
+ }
+ | option(PURE) FUNCTION ID params_decl return_decl EQUALS CODE
+ {
+ $3, Ast.EFuncDefn ($loc, ($4, $5, $1 <> None, $7))
}
| TACTIC_KEYWORD TACTIC params_decl EQUALS CODE
{
}
| TACTIC_KEYWORD TACTIC params_decl EQUALS CODE
{