Changeset 4513 for trunk/compiler

Show
Ignore:
Timestamp:
10/18/08 08:58:16 (3 months ago)
Author:
pmoura
Message:

Modified the implementation of the file/1 entity property to not depend on the stream_property/2 built-in predicate support for the file_name/1 property.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4512 r4513  
    258258:- dynamic('$lgt_pp_synchronized_'/0).          % '$lgt_pp_synchronized_' 
    259259 
    260 :- dynamic('$lgt_pp_file_encoding_'/2).         % '$lgt_pp_file_encoding_'(LogtalkEncoding, PrologEncoding))) 
    261 :- dynamic('$lgt_pp_file_bom_'/1).              % '$lgt_pp_file_bom_'(BOM))) 
     260:- dynamic('$lgt_pp_file_encoding_'/2).         % '$lgt_pp_file_encoding_'(LogtalkEncoding, PrologEncoding) 
     261:- dynamic('$lgt_pp_file_bom_'/1).              % '$lgt_pp_file_bom_'(BOM) 
     262:- dynamic('$lgt_pp_file_name_'/1).             % '$lgt_pp_file_name_'(File) 
    262263 
    263264:- dynamic('$lgt_pp_file_rclause_'/1).          % '$lgt_pp_file_rclause_'(Clause) 
     
    45604561    '$lgt_save_global_op_table', 
    45614562    '$lgt_file_name'(logtalk, File, Source), 
     4563    asserta('$lgt_pp_file_name_'(Source)), 
    45624564    catch( 
    45634565        open(Source, read, Input), 
     
    45874589        '$lgt_compiler_error_handler'(Output, OutputError)),    % with non-ISO compliant Prolog compilers 
    45884590    close(Output), 
     4591    retractall('$lgt_pp_file_name_'(_)), 
    45894592    '$lgt_restore_global_op_table'. 
    45904593 
     
    46574660% adds entity properties related to the entity source file 
    46584661 
    4659 '$lgt_add_entity_file_properties'(Entity, Input) :- 
     4662'$lgt_add_entity_file_properties'(Entity, _Input) :- 
    46604663%   (   catch('$lgt_stream_current_line_number'(Input, Line), _, fail) -> 
    46614664%       assertz('$lgt_pp_file_rclause_'('$lgt_entity_property_'(Entity, line_count(Line)))) 
    46624665%   ;   true 
    46634666%   ), 
    4664     (   catch(stream_property(Input, file_name(File)), _, fail) -> 
    4665         assertz('$lgt_pp_rclause_'('$lgt_entity_property_'(Entity, file(File)))) 
    4666     ;   true 
    4667     ). 
     4667    '$lgt_pp_file_name_'(File) -> 
     4668    assertz('$lgt_pp_rclause_'('$lgt_entity_property_'(Entity, file(File)))). 
    46684669 
    46694670 
     
    49114912    retractall('$lgt_pp_file_encoding_'(_, _)), 
    49124913    retractall('$lgt_pp_file_bom_'(_)), 
     4914    retractall('$lgt_pp_file_name_'(_)), 
    49134915    retractall('$lgt_pp_file_rclause_'(_)). 
    49144916