On 28/11/2014 9:46, Shigio YAMAGUCHI wrote:
> Hi,
> Your patch picks up many correct definitions which were overlooked.
> However, it seems that it also has side effects.

Fixed.  This one is based on the previous one.

-- 
Jason.
diff -urp global-6.3.3/libparser/Cpp.c global-6.3-3/libparser/Cpp.c
--- global-6.3.3/libparser/Cpp.c        2014-11-27 17:28:16 +1000
+++ global-6.3-3/libparser/Cpp.c        2014-11-30 19:01:49 +1000
@@ -189,8 +189,8 @@ Cpp(const struct parser_param *param)
                                if (c == CPP___ATTRIBUTE__)
                                        process_attribute(param);
                        if (c == SYMBOL) {
-                               int newlines = 0;
                                char *saveline;
+                               int savelineno = lineno;
                                strbuf_reset(sb);
                                strbuf_puts(sb, sp);
                                saveline = strbuf_value(sb);
@@ -198,23 +198,22 @@ Cpp(const struct parser_param *param)
                                        strlimcpy(classname, token, 
sizeof(classname));
                                        c = nexttoken(interested, 
cpp_reserved_word);
                                        if (c == SYMBOL) {
-                                               newlines = 0;
+                                               savelineno = lineno;
                                                strbuf_reset(sb);
                                                strbuf_puts(sb, sp);
                                                saveline = strbuf_value(sb);
-                                       } else if (c == '\n')
-                                               ++newlines;
-                                       else
+                                       } else if (c != '\n')
                                                break;
                                }
                                /*
                                 * Ignore forward definitions.
                                 * "class name;"
                                 */
-                               if (c != ';') {
+                               if (c == '{') /* } */ {
                                        startclass = 1;
-                                       PUT(PARSER_DEF, classname, lineno - 
newlines, saveline);
-                               }
+                                       PUT(PARSER_DEF, classname, savelineno, 
saveline);
+                               } else if (c != ';')
+                                       PUT(PARSER_REF_SYM, classname, 
savelineno, saveline);
                        }
                        pushbacktoken();
                        break;
_______________________________________________
Bug-global mailing list
Bug-global@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-global

Reply via email to