fix reverted tests, ensure files are loaded before goals (#2315)
This commit is contained in:
@@ -40,10 +40,21 @@ load_scryerrc :-
|
|||||||
(\+ disabled_init_file -> load_scryerrc ; true),
|
(\+ disabled_init_file -> load_scryerrc ; true),
|
||||||
repl.
|
repl.
|
||||||
|
|
||||||
|
args_consults_goals([], [], []).
|
||||||
|
args_consults_goals([Arg|Args], Consults, Goals) :-
|
||||||
|
arg_consults_goals(Arg, Args, Consults, Goals).
|
||||||
|
|
||||||
|
arg_consults_goals(c(Mod), Args, [c(Mod)|Consults], Goals) :-
|
||||||
|
args_consults_goals(Args, Consults, Goals).
|
||||||
|
arg_consults_goals(g(Goal), Args, Consults, [g(Goal)|Goals]) :-
|
||||||
|
args_consults_goals(Args, Consults, Goals).
|
||||||
|
|
||||||
delegate_task([], []).
|
delegate_task([], []).
|
||||||
delegate_task([], Goals0) :-
|
delegate_task([], Goals0) :-
|
||||||
reverse(Goals0, Goals),
|
|
||||||
(\+ disabled_init_file -> load_scryerrc ; true),
|
(\+ disabled_init_file -> load_scryerrc ; true),
|
||||||
|
reverse(Goals0, Goals1),
|
||||||
|
args_consults_goals(Goals1, Consults, Goals),
|
||||||
|
run_goals(Consults),
|
||||||
run_goals(Goals),
|
run_goals(Goals),
|
||||||
repl.
|
repl.
|
||||||
|
|
||||||
@@ -57,7 +68,7 @@ delegate_task([Arg0|Args], Goals0) :-
|
|||||||
!,
|
!,
|
||||||
delegate_task(Args, Goals0)
|
delegate_task(Args, Goals0)
|
||||||
; atom_chars(Mod, Arg0),
|
; atom_chars(Mod, Arg0),
|
||||||
delegate_task(Args, [t(consult(Mod))|Goals0])
|
delegate_task(Args, [c(Mod)|Goals0])
|
||||||
).
|
).
|
||||||
|
|
||||||
print_help :-
|
print_help :-
|
||||||
@@ -98,6 +109,7 @@ ignore_machine_arg.
|
|||||||
|
|
||||||
arg_type(g).
|
arg_type(g).
|
||||||
arg_type(t).
|
arg_type(t).
|
||||||
|
arg_type(c(_)).
|
||||||
arg_type(g(_)).
|
arg_type(g(_)).
|
||||||
arg_type(t(_)).
|
arg_type(t(_)).
|
||||||
|
|
||||||
@@ -134,12 +146,12 @@ run_goals([g(Gs0)|Goals]) :- !,
|
|||||||
write_term(Goal, [variable_names(VNs),double_quotes(DQ)]), nl
|
write_term(Goal, [variable_names(VNs),double_quotes(DQ)]), nl
|
||||||
),
|
),
|
||||||
run_goals(Goals).
|
run_goals(Goals).
|
||||||
run_goals([t(Goal)|Goals]) :- !,
|
run_goals([c(Mod)|Goals]) :- !,
|
||||||
( catch(user:Goal, E, print_exception(E)) ->
|
( catch(consult(Mod), E, print_exception(E)) ->
|
||||||
true
|
true
|
||||||
; write('% Warning: initialization failed for: '),
|
; write('% Warning: initialization failed for: '),
|
||||||
double_quotes_option(DQ),
|
double_quotes_option(DQ),
|
||||||
write_term(Goal, [double_quotes(DQ)]), nl
|
write_term(consult(Mod), [double_quotes(DQ)]), nl
|
||||||
),
|
),
|
||||||
run_goals(Goals).
|
run_goals(Goals).
|
||||||
run_goals([Goal|_]) :-
|
run_goals([Goal|_]) :-
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
# issue 820
|
# issue 820
|
||||||
args = ["-f", "--no-add-history", "goals.pl", "-g", "test,halt"]
|
args = ["-f", "--no-add-history", "-g", "test,halt", "goals.pl"]
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
# issue 820
|
# issue 820
|
||||||
args = ["-f", "--no-add-history", "goals.pl", "-g", "test", "-g", "halt"]
|
args = ["-f", "--no-add-history", "-g", "test", "-g", "halt", "goals.pl"]
|
||||||
|
|||||||
Reference in New Issue
Block a user