]> Repositorios git - scryer-prolog.git/commitdiff
correct error reporting for variable_names write option
authorMark Thom <[email protected]>
Tue, 7 May 2019 02:45:32 +0000 (22:45 -0400)
committerMark Thom <[email protected]>
Tue, 7 May 2019 02:45:32 +0000 (22:45 -0400)
src/prolog/lib/builtins.pl

index 270476284c286bfd7bd75eb6bd01927a21f58095..5c65e610d89f78e3c17a8a9b99e515235863599e 100644 (file)
@@ -220,7 +220,7 @@ is_write_option(Functor) :-
     Functor =.. [Name, Arg],
     ( Arg == true -> 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))
     ; throw(error(domain_error(write_option, Functor), write_term/2))
     ), % 8.14.2.3 e)
@@ -249,6 +249,7 @@ must_be_var_names_list_([]).
 must_be_var_names_list_([VarName | VarNames]) :-
     (  nonvar(VarName), VarName = (Atom = _) ->
        (  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))