tag DCG constructs with module names for proper resolution
This commit is contained in:
@@ -315,6 +315,7 @@ compile_dispatch(user:goal_expansion(Term, Terms), Evacuable) :-
|
||||
compile_dispatch((user:goal_expansion(Term, Terms) :- Body), Evacuable) :-
|
||||
'$add_goal_expansion_clause'(user, (goal_expansion(Term, Terms) :- Body), Evacuable).
|
||||
|
||||
|
||||
remove_module(Module, Evacuable) :-
|
||||
( nonvar(Module),
|
||||
Module = library(ModuleName),
|
||||
@@ -708,17 +709,13 @@ expand_goal(UnexpandedGoals, Module, ExpandedGoals, HeadVars) :-
|
||||
)
|
||||
).
|
||||
|
||||
thread_goals(Goals0, Goals1, Functor) :-
|
||||
( var(Goals0) ->
|
||||
Goals0 = Goals1
|
||||
; ( Goals0 = [G | Gs] ->
|
||||
( Gs = [] ->
|
||||
Goals1 = G
|
||||
; Goals1 =.. [Functor, G, Goals2],
|
||||
thread_goals(Gs, Goals2, Functor)
|
||||
)
|
||||
; Goals1 = Goals0
|
||||
)
|
||||
thread_goals([SG|SGs], G, F) :-
|
||||
( SGs \== [], functor(G, F, 2) ->
|
||||
arg(1, G, SG),
|
||||
arg(2, G, Gs1),
|
||||
thread_goals(SGs, Gs1, F)
|
||||
; SG = G,
|
||||
SGs = []
|
||||
).
|
||||
|
||||
thread_goals(Goals0, Goals1, Hole, Functor) :-
|
||||
@@ -734,6 +731,20 @@ thread_goals(Goals0, Goals1, Hole, Functor) :-
|
||||
)
|
||||
).
|
||||
|
||||
/*
|
||||
thread_goals(Goals0, Goals1, Functor) :-
|
||||
( var(Goals0) ->
|
||||
Goals0 = Goals1
|
||||
; ( Goals0 = [G | Gs] ->
|
||||
( Gs = [] ->
|
||||
Goals1 = G
|
||||
; Goals1 =.. [Functor, G, Goals2],
|
||||
thread_goals(Gs, Goals2, Functor)
|
||||
)
|
||||
; Goals1 = Goals0
|
||||
)
|
||||
).
|
||||
*/
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
|
||||
Reference in New Issue
Block a user