Skip to content

Commit

Permalink
Fix compilation of meta-arguments of calls to Prolog meta-predicates …
Browse files Browse the repository at this point in the history
…that are explicit-qualified module terms
  • Loading branch information
pmoura committed May 1, 2016
1 parent 412fad0 commit 28c86b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Expand Up @@ -30,6 +30,9 @@ Logtalk compiler and runtime
* FIXED: Bug where the compiler could fail to detect some discontiguous
predicates.

* FIXED: Compilation of meta-arguments of calls to Prolog meta-predicates
that are explicit-qualified module terms.

Documentation
-------------

Expand Down
12 changes: 11 additions & 1 deletion core/core.pl
Expand Up @@ -11928,13 +11928,23 @@
'$lgt_compile_prolog_meta_arguments'([], [], _, [], []).

'$lgt_compile_prolog_meta_arguments'([Arg| Args], [MArg| MArgs], Ctx, [TArg| TArgs], [DArg| DArgs]) :-
( integer(MArg), MArg > 0 ->
( nonvar(Arg),
'$lgt_module_meta_argument'(MArg, Arg),
'$lgt_prolog_feature'(modules, supported) ->
TArg = Arg, DArg = Arg
; integer(MArg),
MArg > 0 ->
'$lgt_compile_prolog_meta_argument'(closure(MArg), Arg, Ctx, TArg, DArg)
; '$lgt_compile_prolog_meta_argument'(MArg, Arg, Ctx, TArg, DArg)
),
'$lgt_compile_prolog_meta_arguments'(Args, MArgs, Ctx, TArgs, DArgs).


'$lgt_module_meta_argument'(1, ':'(_)) :-
!.
'$lgt_module_meta_argument'(_, ':'(_,_)).


'$lgt_compile_prolog_meta_argument'(closure(N), Arg, Ctx, TArg, DArg) :-
% closure
'$lgt_must_be'(var_or_callable, Arg),
Expand Down

0 comments on commit 28c86b0

Please sign in to comment.