This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Java: Fixing net PR #32


I checked in this patch to fix the Java net PR #32.

./A

Thu Aug 26 09:10:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (lookup_cl): Changed leading comment. Now does its best
        to set the column number.
        (qualify_ambiguous_name): Take WFL wrappers into account.

Index: parse.y
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/parse.y,v
retrieving revision 1.105
diff -u -p -r1.105 parse.y
--- parse.y	1999/08/25 13:59:26	1.105
+++ parse.y	1999/08/26 16:29:52
@@ -5099,14 +5099,15 @@ lookup_java_method2 (clas, method_decl, 
   return NULL_TREE;
 }
 
-/* Return the line that matches DECL line number. Used during error
-   report */
+/* Return the line that matches DECL line number, and try its best to
+   position the column number. Used during error reports.  */
 
 static tree
 lookup_cl (decl)
      tree decl;
 {
   static tree cl = NULL_TREE;
+  char *line, *found;
   
   if (!decl)
     return NULL_TREE;
@@ -5117,6 +5118,14 @@ lookup_cl (decl)
   EXPR_WFL_FILENAME_NODE (cl) = get_identifier (DECL_SOURCE_FILE (decl));
   EXPR_WFL_SET_LINECOL (cl, DECL_SOURCE_LINE_FIRST (decl), -1);
 
+  line = java_get_line_col (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (cl)),
+			    EXPR_WFL_LINENO (cl), EXPR_WFL_COLNO (cl));
+
+  found = strstr ((const char *)line, 
+		  (const char *)IDENTIFIER_POINTER (DECL_NAME (decl)));
+  if (found)
+    EXPR_WFL_SET_LINECOL (cl, EXPR_WFL_LINENO (cl), found - line);
+
   return cl;
 }
 
@@ -7861,8 +7870,15 @@ qualify_ambiguous_name (id)
 	again = 1;
       }
     else 
-      name = EXPR_WFL_NODE (qual_wfl);
-    
+      {
+	name = EXPR_WFL_NODE (qual_wfl);
+	if (!name)
+	  {
+	    qual = EXPR_WFL_QUALIFICATION (qual_wfl);
+	    again = 1;
+	  }
+      }
+
     /* If we have a THIS (from a primary), we set the context accordingly */
     if (name == this_identifier_node)
       {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]