ide/Debugger/watches: Fix unichar evaluation broken by fa765a838029ec71a86787e95ebcab...
authorJerome St-Louis <jerome@ecere.com>
Wed, 9 Jul 2014 07:29:11 +0000 (03:29 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 9 Jul 2014 07:33:41 +0000 (03:33 -0400)
- Corrected reference to unichar full name
- Corrected message to say invalid 'Codepoint' rather than 'Keypoint'
- Fixed sizeof evaluation for L"strings"

compiler/bootstrap/libec/bootstrap/ast.c
compiler/libec/src/ast.ec
ide/src/debugger/Debugger.ec

index 0195a8c..d88eff8 100644 (file)
@@ -3700,6 +3700,8 @@ char ch;
 unsigned int escaped = 0;
 char * s = d->initializer->__anon1.exp->__anon1.__anon2.string;
 
+if(s[0] == 'L')
+s++;
 for(c = 1; (ch = s[c]); c++)
 {
 if(ch == '\\' && !escaped)
index 5ce9fb3..6b696f8 100644 (file)
@@ -979,6 +979,7 @@ Declaration MkDeclaration(OldList specifiers, OldList initDeclarators)
                         char ch;
                         bool escaped = false;
                         char * s = d.initializer.exp.string;
+                        if(s[0] == 'L') s++;
 
                         // MAKE MORE ACCURATE
                         for(c = 1; (ch = s[c]); c++)
index 0b028eb..7f4b802 100644 (file)
@@ -3070,7 +3070,7 @@ class Debugger
                         result = true;
                      }
                      else if(wh.type && (wh.type.kind == charType || (wh.type.kind == classType && wh.type._class &&
-                              wh.type._class.registered && !strcmp(wh.type._class.registered.fullName, "ecere::com::unichar"))) )
+                              wh.type._class.registered && !strcmp(wh.type._class.registered.fullName, "unichar"))) )
                      {
                         unichar value;
                         int signedValue;
@@ -3128,7 +3128,7 @@ class Debugger
                         else if(value > 256 || wh.type.kind != charType)
                         {
                            if(value > 0x10FFFF || !GetCharCategory(value))
-                              snprintf(string, sizeof(string), $"Invalid Unicode Keypoint (0x%08X)", value);
+                              snprintf(string, sizeof(string), $"Invalid Unicode Codepoint (0x%08X)", value);
                            else
                               snprintf(string, sizeof(string), "\'%s\' (U+%04X)", charString, value);
                         }