]> Repositorios git - scryer-prolog.git/commitdiff
invoke '$default_attr_list' in project_attributes.pl (#1748)
authorMark Thom <[email protected]>
Mon, 27 Feb 2023 05:41:38 +0000 (22:41 -0700)
committerMark Thom <[email protected]>
Mon, 27 Feb 2023 05:42:02 +0000 (22:42 -0700)
src/machine/project_attributes.pl

index 20a19e975d8b112e643a83016f4f9eb911e9151b..f54797c83e37ca617edb0a7ec7a4a6f579711bff 100644 (file)
@@ -38,20 +38,6 @@ call_project_attributes([Module|Modules], QueryVars, AttrVars) :-
        nl
     ).
 
-call_query_var_goals([], _, []).
-call_query_var_goals([AttrVar|AttrVars], Module, Goals) :-
-    (  catch((  Module:attribute_goals(AttrVar, Goals, RGoals0),
-                   atts:'$default_attr_list'(Module, AttrVar, RGoals0, RGoals)
-                ),
-                E,
-                (  '$project_atts':'$print_attribute_goals_exception'(Module, E),
-                       atts:'$default_attr_list'(Module, AttrVar, Goals, RGoals)
-                ))
-    -> true
-    ;  atts:'$default_attr_list'(Module, AttrVar, Goals, RGoals)
-    ),
-    call_query_var_goals(AttrVars, Module, RGoals).
-
 call_attr_var_goals([], _, []).
 call_attr_var_goals([AttrVar|AttrVars], Module, Goals) :-
     (  catch(Module:attribute_goals(AttrVar, Goals, RGoals),
@@ -90,21 +76,26 @@ copy_attribute_modules([Module:_|Attrs]) -->
     [Module],
     copy_attribute_modules(Attrs).
 
-attribute_goals_or_fail(M, V, V0, V1) :-
+gather_residual_goals_(M, V, V0, V1) :-
     (  catch(M:attribute_goals(V, V0, V1),
              E,
-             '$project_atts':'$print_attribute_goals_exception'(M, E)
+             ('$project_atts':'$print_attribute_goals_exception'(M, E),
+              V0 = V1)
             ) ->
        true
     ;  V0 = V1
     ).
 
+gather_residual_goals(M, V) -->
+    gather_residual_goals_(M, V),
+    atts:'$default_attr_list'(M, V).
+
 gather_residual_goals([]) --> [].
 gather_residual_goals([V|Vs]) -->
     { '$get_attr_list'(V, Attrs),
       phrase(copy_attribute_modules(Attrs), Modules0),
       sort(Modules0, Modules) },
-    foldl(V+\M^attribute_goals_or_fail(M, V), Modules),
+    foldl(V+\M^gather_residual_goals(M, V), Modules),
     gather_residual_goals(Vs).
 
 delete_all_attributes_from_var(V) :- '$delete_all_attributes_from_var'(V).