git.annexia.org
/
whenjobs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0c9faf5
)
Use labelled arguments in call_stmt.
author
Richard W.M. Jones
<rjones@redhat.com>
Tue, 28 Feb 2012 11:55:04 +0000
(11:55 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Tue, 28 Feb 2012 11:55:04 +0000
(11:55 +0000)
lib/pa_when.ml
patch
|
blob
|
history
diff --git
a/lib/pa_when.ml
b/lib/pa_when.ml
index
00bfd14
..
2f415ea
100644
(file)
--- a/
lib/pa_when.ml
+++ b/
lib/pa_when.ml
@@
-88,7
+88,7
@@
module M = Ast.Meta.Make (Ast.Meta.MetaGhostLoc)
let lift_expr = M.Expr.meta_expr
(* Handle a top level statement. *)
let lift_expr = M.Expr.meta_expr
(* Handle a top level statement. *)
-let rec call_stmt
name pre
post (_loc, stmt, sh) =
+let rec call_stmt
?name ?pre ?
post (_loc, stmt, sh) =
let name =
match name with
| None -> let name = unique_job_name () in <:expr< $str:name$ >>
let name =
match name with
| None -> let name = unique_job_name () in <:expr< $str:name$ >>
@@
-224,12
+224,12
@@
EXTEND Gram
(* "str_item" is a top level statement in an OCaml program. *)
str_item: LEVEL "top" [
(* "str_item" is a top level statement in an OCaml program. *)
str_item: LEVEL "top" [
- [ s = statement -> call_stmt
None None None
s ]
+ [ s = statement -> call_stmt s ]
| [ "job"; name = expr;
pre = OPT pre;
post = OPT post;
s = statement ->
| [ "job"; name = expr;
pre = OPT pre;
post = OPT post;
s = statement ->
- call_stmt
(Some name) pre
post s ]
+ call_stmt
~name ?pre ?
post s ]
];
END
];
END