Skip to content

Commit

Permalink
Fix compilation of SWI-Prolog proprietary directives when decorating …
Browse files Browse the repository at this point in the history
…the generated code with source location data
  • Loading branch information
pmoura committed Oct 26, 2016
1 parent 52032a2 commit 7d44c58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ automatically call `logtalk_make/0` when calling `make/0`.
* IMPROVED: Faster implementation of the internal '$lgt_predicate_property'/2
predicate for SWI-Prolog.

* FIXED: Compilation of SWI-Prolog proprietary directives when decorating the
generated code with source location data.

Logtalk compiler and runtime
----------------------------

Expand Down
10 changes: 5 additions & 5 deletions adapters/swi.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Adapter file for SWI Prolog 6.6.0 and later versions
% Last updated on October 22, 2016
% Last updated on October 25, 2016
%
% This file is part of Logtalk <http://logtalk.org/>
% Copyright 1998-2016 Paulo Moura <pmoura@logtalk.org>
Expand Down Expand Up @@ -933,15 +933,15 @@
!,
write_canonical(Stream, Term), write(Stream, '.\n').

'$lgt_write_compiled_term'(Stream, Term, user, File, Line) :-
!,
write_canonical(Stream, '$source_location'(File,Line):Term), write(Stream, '.\n').

'$lgt_write_compiled_term'(Stream, (:- Directive), _, _, _) :-
% to cope with {(:- Directive)} entity terms
!,
write_canonical(Stream, (:- Directive)), write(Stream, '.\n').

'$lgt_write_compiled_term'(Stream, Term, user, File, Line) :-
!,
write_canonical(Stream, '$source_location'(File,Line):Term), write(Stream, '.\n').

'$lgt_write_compiled_term'(Stream, Term, aux, _, _) :-
!,
( Term = (Head :- _) ->
Expand Down

0 comments on commit 7d44c58

Please sign in to comment.