Changeset 2665

Show
Ignore:
Timestamp:
11/06/08 21:57:27 (2 months ago)
Author:
maxr
Message:

ada: use unicode version of to_upper to compare identifiers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tendra/src/producers/ada/xasis/xasis-utils.adb

    r2644 r2665  
    1515with XASIS.Types; 
    1616 
     17with Gela.To_Upper; use Gela; 
     18 
    1719package body XASIS.Utils is 
    1820 
     
    3032     (Left, Right : Asis.Program_Text) return Boolean 
    3133   is 
    32       use Ada.Characters.Handling; 
    33       L : constant String := To_Lower (To_String (Left)); 
    34       R : constant String := To_Lower (To_String (Right)); 
     34      L_Text : Wide_String (1 .. Left'Length * 3); 
     35      L_Last : Natural; 
     36      R_Text : Wide_String (1 .. Right'Length * 3); 
     37      R_Last : Natural; 
    3538   begin 
    3639      if Left (Left'First) = ''' then 
    3740         return Left = Right; 
     41      elsif Left (Left'First) = '"' then 
     42         To_Upper.Identifier (Left,  L_Text, L_Last); 
     43         To_Upper.Identifier (Right, R_Text, R_Last); 
     44 
     45         if L_Last > 0 then 
     46            return L_Text (1 .. L_Last) = R_Text (1 .. R_Last); 
     47         else 
     48            return Left = Right; 
     49         end if; 
    3850      else 
    39          if R = "false" then 
    40             return L = R
    41          end if; 
    42          return To_Lower (To_String (Left)) = To_Lower (To_String (Right)); 
     51         To_Upper.Identifier (Left,  L_Text, L_Last); 
     52         To_Upper.Identifier (Right, R_Text, R_Last)
     53 
     54         return L_Text (1 .. L_Last) = R_Text (1 .. R_Last); 
    4355      end if; 
    4456   end Are_Equal_Identifiers;