correct error reporting for variable_names write option
This commit is contained in:
@@ -220,7 +220,7 @@ is_write_option(Functor) :-
|
|||||||
Functor =.. [Name, Arg],
|
Functor =.. [Name, Arg],
|
||||||
( Arg == true -> true
|
( Arg == true -> true
|
||||||
; Arg == false -> true
|
; Arg == false -> true
|
||||||
; Name == variable_names -> must_be_var_names_list(Arg)
|
; Name == variable_names -> must_be_var_names_list(Arg)
|
||||||
; var(Arg) -> throw(error(instantiation_error, write_term/2))
|
; var(Arg) -> throw(error(instantiation_error, write_term/2))
|
||||||
; throw(error(domain_error(write_option, Functor), write_term/2))
|
; throw(error(domain_error(write_option, Functor), write_term/2))
|
||||||
), % 8.14.2.3 e)
|
), % 8.14.2.3 e)
|
||||||
@@ -249,6 +249,7 @@ must_be_var_names_list_([]).
|
|||||||
must_be_var_names_list_([VarName | VarNames]) :-
|
must_be_var_names_list_([VarName | VarNames]) :-
|
||||||
( nonvar(VarName), VarName = (Atom = _) ->
|
( nonvar(VarName), VarName = (Atom = _) ->
|
||||||
( atom(Atom) -> must_be_var_names_list_(VarNames)
|
( atom(Atom) -> must_be_var_names_list_(VarNames)
|
||||||
|
; var(Atom) -> throw(error(instantiation_error, write_term/2))
|
||||||
; throw(error(domain_error(write_options, variable_names(VarName)), write_term/2))
|
; throw(error(domain_error(write_options, variable_names(VarName)), write_term/2))
|
||||||
)
|
)
|
||||||
; throw(error(domain_error(write_options, variable_names(VarName)), write_term/2))
|
; throw(error(domain_error(write_options, variable_names(VarName)), write_term/2))
|
||||||
|
|||||||
Reference in New Issue
Block a user