Changeset 4534 for trunk/compiler

Show
Ignore:
Timestamp:
10/23/08 04:53:05 (3 months ago)
Author:
pmoura
Message:

Updated the Logtalk compiler to provide file information when printing redefined entity warnings if the files of the new and the old definitions are different (requires support for the file/2 entity property).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4533 r4534  
    42334233 
    42344234 
    4235 % '$lgt_check_redefined_entities'(+atom) 
     4235% '$lgt_check_redefined_entities' 
    42364236% 
    42374237% check and print a warning for all entities that are about to be redefined; 
     
    42524252 
    42534253 
    4254 % '$lgt_redefined_entity'(+atom, @entity_identifier, -atom, -atom) 
     4254% '$lgt_redefined_entity'(@entity_identifier, -atom, -atom) 
    42554255% 
    42564256% true if an entity of the same name is already loaded; returns entity type 
     
    42644264        Type = category 
    42654265    ), 
    4266     (   '$lgt_entity_property_'(Entity, file(OldBase, OldPath)), 
     4266    (   % check file information using the file/2 entity property, if available: 
     4267        '$lgt_entity_property_'(Entity, file(OldBase, OldPath)), 
    42674268        '$lgt_pp_file_rclause_'('$lgt_entity_property_'(Entity, file(NewBase, NewPath))), 
    42684269        (OldPath \== NewPath; OldBase \== NewBase) -> 
    42694270        File = OldBase-OldPath 
    4270     ;   File = nil 
    4271     ). 
    4272  
    4273  
    4274  
    4275 % '$lgt_report_redefined_entity'(+atom, @entity_identifier) 
     4271    ;   % either no file/2 entity property or we're reloading the same file  
     4272        File = nil 
     4273    ). 
     4274 
     4275 
     4276 
     4277% '$lgt_report_redefined_entity'(+atom, @entity_identifier, +atom) 
    42764278% 
    42774279% prints a warning for redefined entities 
     
    42844286        (   File == nil -> 
    42854287            true 
    4286         ;   File = Base-Path, 
     4288        ;   % we've conflicting entities coming from different source files: 
     4289            File = Base-Path, 
    42874290            write('              loaded from file '), write(Base), write(' ('), write(Path), write(')'), nl 
    42884291        )