# Pass through normal targets to Goalfile.in
-# XXX Why can't this parse "all" instead of "all ()"?
all clean depend install check maintainer-clean: src/goals
- ./run src/goals "$@ ()"
+ ./run src/goals $@
# If src/goals doesn't exist then brute-force build it. Once we have
# src/goals we can rebuild it and other parts of the project using
You might only allow defaults to be added to the end, or you
might allow goals to be called with labelled parameters.
-Fix: You must use 'all ()' on the command line.
-
Deleting target files if goals is interrupted, but only if the
timestamp changes (what about non-*files?). Also: atomic code. This
will delete the target if the code doesn't run to completion. (make
failwithf "%a: parse error" string_position lexbuf
let parse_expr lexbuf =
- try Parser.expr Lexer.read lexbuf
+ try Parser.expr_only Lexer.read lexbuf
with
| SyntaxError msg ->
failwithf "%a: %s" string_position lexbuf msg
(* Start nonterminals. *)
%start <Ast.expr Ast.Env.t> file
-%start <Ast.expr> expr
+%start <Ast.expr> expr_only
%%
file:
| LEFT_PAREN separated_list(COMMA, expr) RIGHT_PAREN { $2 }
;
+(* This is used by Parse.parse_expr where we have to parse
+ * a standalone string (eg. from the command line).
+ *)
+expr_only:
+ | expr EOF { $1 }
+ ;
+
(* http://gallium.inria.fr/blog/lr-lists/ *)
right_flexible_list(delim, X):
| (* nothing *) { [] }