SF.net SVN: geany: [1810] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Aug 17 14:50:56 UTC 2007


Revision: 1810
          http://geany.svn.sourceforge.net/geany/?rev=1810&view=rev
Author:   ntrel
Date:     2007-08-17 07:50:55 -0700 (Fri, 17 Aug 2007)

Log Message:
-----------
Fix parsing C macro argument list.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tagmanager/get.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-08-17 11:48:30 UTC (rev 1809)
+++ trunk/ChangeLog	2007-08-17 14:50:55 UTC (rev 1810)
@@ -3,6 +3,8 @@
  * src/plugins.c:
    Apply patch from Jeff Pohlmeyer to fix warning when unloading plugins
    that use signals when quitting (thanks).
+ * tagmanager/get.c:
+   Fix parsing C macro argument list.
 
 
 2007-08-16  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/tagmanager/get.c
===================================================================
--- trunk/tagmanager/get.c	2007-08-17 11:48:30 UTC (rev 1809)
+++ trunk/tagmanager/get.c	2007-08-17 14:50:55 UTC (rev 1810)
@@ -296,7 +296,7 @@
 	return isIgnore ();
 }
 
-static void makeDefineTag (const char *const name)
+static void makeDefineTag (const char *const name, boolean parameterized)
 {
 	const boolean isFileScope = (boolean) (! isHeaderFile ());
 
@@ -304,23 +304,36 @@
 		(! isFileScope  ||  Option.include.fileScope))
 	{
 		tagEntryInfo e;
+
 		initTagEntry (&e, name);
+
 		e.lineNumberEntry = (boolean) (Option.locate != EX_PATTERN);
 		e.isFileScope  = isFileScope;
 		e.truncateLine = TRUE;
 		e.kindName     = "macro";
 		e.kind         = 'd';
+		if (parameterized)
+			e.extensionFields.arglist = getArglistFromPos(getInputFilePosition()
+				, e.name);
 		makeTagEntry (&e);
+		if (parameterized)
+			free((char *) e.extensionFields.arglist);
 	}
 }
 
 static void directiveDefine (const int c)
 {
+	boolean parameterized;
+	int nc;
+
 	if (isident1 (c))
 	{
 		readIdentifier (c, Cpp.directive.name);
+		nc = fileGetc ();
+		fileUngetc (nc);
+		parameterized = (boolean) (nc == '(');
 		if (! isIgnore ())
-			makeDefineTag (vStringValue (Cpp.directive.name));
+			makeDefineTag (vStringValue (Cpp.directive.name), parameterized);
 	}
 	Cpp.directive.state = DRCTV_NONE;
 }
@@ -340,7 +353,7 @@
 			if (isident1 (c))
 			{
 				readIdentifier (c, Cpp.directive.name);
-				makeDefineTag (vStringValue (Cpp.directive.name));
+				makeDefineTag (vStringValue (Cpp.directive.name), FALSE);
 			}
 		}
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list