2001-11-06 Pierre Muller <muller@ics.u-strasbg.fr>
authorPierre Muller <muller@sourceware.org>
Fri, 9 Nov 2001 09:46:40 +0000 (09:46 +0000)
committerPierre Muller <muller@sourceware.org>
Fri, 9 Nov 2001 09:46:40 +0000 (09:46 +0000)
* p-exp.y (yylex): Only change case of expression if symbol is found.
Also check for GPC standard name form.

gdb/ChangeLog
gdb/p-exp.y

index b714e7878bb3208987f5832a78e05958daefffd7..db07d6c84f4d5c751d75a23676cd57213b174f1d 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-06 Pierre Muller  <muller@ics.u-strasbg.fr>
+
+       * p-exp.y (yylex): Only change case of expression if symbol is found.
+       Also check for GPC standard name form.
+
 2001-11-08  Andrew Cagney  <ac131313@redhat.com>
 
        * gdb_indent.sh: New file.
index d786af9f6e0efb5374458d2c2316e8d7ac8ca250..d1fcb1b000f6e35c6a6b56dddf3cbc209f340bfd 100644 (file)
@@ -1299,21 +1299,55 @@ yylex ()
                         VAR_NAMESPACE,
                         &is_a_field_of_this,
                         (struct symtab **) NULL);
-    /* second chance uppercased ! */
+    /* second chance uppercased (as Free Pascal does).  */
     if (!sym)
       {
-       for (i = 0;i <= namelen;i++)
+       for (i = 0; i <= namelen; i++)
          {
-           if ((tmp[i]>='a' && tmp[i]<='z'))
+           if ((tmp[i] >= 'a' && tmp[i] <= 'z'))
              tmp[i] -= ('a'-'A');
-           /* I am not sure that copy_name gives excatly the same result ! */
-           if ((tokstart[i]>='a' && tokstart[i]<='z'))
-             tokstart[i] -= ('a'-'A');
          }
-        sym = lookup_symbol (tmp, expression_context_block,
-                        VAR_NAMESPACE,
-                        &is_a_field_of_this,
-                        (struct symtab **) NULL);
+       sym = lookup_symbol (tmp, expression_context_block,
+                        VAR_NAMESPACE,
+                        &is_a_field_of_this,
+                        (struct symtab **) NULL);
+       if (sym)
+         for (i = 0; i <= namelen; i++)
+           {
+             if ((tokstart[i] >= 'a' && tokstart[i] <= 'z'))
+               tokstart[i] -= ('a'-'A');
+           }
+      }
+    /* Third chance Capitalized (as GPC does).  */
+    if (!sym)
+      {
+       for (i = 0; i <= namelen; i++)
+         {
+           if (i == 0)
+             {
+              if ((tmp[i] >= 'a' && tmp[i] <= 'z'))
+                tmp[i] -= ('a'-'A');
+             }
+           else
+           if ((tmp[i] >= 'A' && tmp[i] <= 'Z'))
+             tmp[i] -= ('A'-'a');
+          }
+       sym = lookup_symbol (tmp, expression_context_block,
+                         VAR_NAMESPACE,
+                         &is_a_field_of_this,
+                         (struct symtab **) NULL);
+        if (sym)
+          for (i = 0; i <= namelen; i++)
+            {
+              if (i == 0)
+                {
+                  if ((tokstart[i] >= 'a' && tokstart[i] <= 'z'))
+                    tokstart[i] -= ('a'-'A');
+                }
+              else
+                if ((tokstart[i] >= 'A' && tokstart[i] <= 'Z'))
+                  tokstart[i] -= ('A'-'a');
+            }
       }
     /* Call lookup_symtab, not lookup_partial_symtab, in case there are
        no psymtabs (coff, xcoff, or some future change to blow away the