SF.net SVN: geany:[5821] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun May 29 17:40:50 UTC 2011


Revision: 5821
          http://geany.svn.sourceforge.net/geany/?rev=5821&view=rev
Author:   eht16
Date:     2011-05-29 17:40:50 +0000 (Sun, 29 May 2011)

Log Message:
-----------
When checking for literal strings to ignore, consider also unicode, binary and raw strings.

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2011-05-27 21:00:41 UTC (rev 5820)
+++ trunk/ChangeLog	2011-05-29 17:40:50 UTC (rev 5821)
@@ -1,3 +1,10 @@
+2011-05-29  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * tagmanager/python.c:
+   When checking for literal strings to ignore, consider also
+   unicode, binary and raw strings.
+
+
 2011-05-27  Colomban Wendling  <colomban(at)geany(dot)org>
 
  * src/prefs.c:

Modified: trunk/tagmanager/python.c
===================================================================
--- trunk/tagmanager/python.c	2011-05-27 21:00:41 UTC (rev 5820)
+++ trunk/tagmanager/python.c	2011-05-29 17:40:50 UTC (rev 5821)
@@ -195,10 +195,31 @@
 /* Skip everything up to an identifier start. */
 static const char *skipEverything (const char *cp)
 {
+	int match;
 	for (; *cp; cp++)
 	{
+		match = 0;
 		if (*cp == '"' || *cp == '\'' || *cp == '#')
+			match = 1;
+
+		/* these checks find unicode, binary (Python 3) and raw strings */
+		if (!match && (
+			!strncasecmp(cp, "u'", 2) || !strncasecmp(cp, "u\"", 2) ||
+			!strncasecmp(cp, "r'", 2) || !strncasecmp(cp, "r\"", 2) ||
+			!strncasecmp(cp, "b'", 2) || !strncasecmp(cp, "b\"", 2)))
 		{
+			match = 1;
+			cp += 1;
+		}
+		if (!match && (
+			!strncasecmp(cp, "ur'", 3) || !strncasecmp(cp, "ur\"", 3) ||
+			!strncasecmp(cp, "br'", 3) || !strncasecmp(cp, "br\"", 3)))
+		{
+			match = 1;
+			cp += 2;
+		}
+		if (match)
+		{
 			cp = skipString(cp);
 			if (!*cp) break;
 		}


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