Dear Geany devs,

I've sent the email below to the wrong mailinglist, so here it is again! ;)

My apologies for those who receive this email twice...


-H-


---------- Forwarded message ----------
From: Harold Aling <ge...@sait.nl>
Date: Thu, Nov 12, 2009 at 17:16
Subject: PHP constants are not listed in symbol list (patch attached)
To: Geany general discussion list <ge...@uvena.de>


Dear Geany devs,

I've updated Geany to the latest svn (r4424) and noticed that php
constants didn't show up in the symbol list.

I then baldly opened 'php.c' and started hacking in the regexes to get
them working again. In 'actionscript.c' the constants were part of
"m,macro,macros" so I decided to change that in php.c too. Constants
were showing again! ;)

I also remove a duplicate regex and also added one in my patch to show
constants in a "const NAME = 'value';" notation so all constants are
correctly parsed from this example:


<?php
abstract class test {
 const TEST = 'test';
}
define('TEST2', 'test');
?>


Cheers!


Harold
Index: tagmanager/php.c
===================================================================
--- tagmanager/php.c	(revision 4424)
+++ tagmanager/php.c	(working copy)
@@ -72,12 +72,12 @@
 {
 	addTagRegex(language, "^[ \t]*((final|abstract)[ \t]+)*class[ \t]+([" ALPHA "_][" ALNUM "_]*)",
 		"\\3", "c,class,classes", NULL);
-	addTagRegex(language, "^[ \t]*((final|abstract)[ \t]+)*class[ \t]+([" ALPHA "_][" ALNUM "_]*)",
-		"\\3", "c,class,classes", NULL);
 	addTagRegex(language, "^[ \t]*interface[ \t]+([" ALPHA "_][" ALNUM "_]*)",
 		"\\1", "i,interface,interfaces", NULL);
 	addTagRegex(language, "^[ \t]*define[ \t]*\\([ \t]*['\"]?([" ALPHA "_][" ALNUM "_]*)",
-		"\\1", "d,define,constant definitions", NULL);
+		"\\1", "m,macro,macros", NULL);
+	addTagRegex(language, "^[ \t]*const[ \t]*([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]",
+		"\\1", "m,macro,macros", NULL);
 	addTagRegex(language, "^[ \t]*((public|protected|private|static)[ \t]+)*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)",
 		"\\3", "f,function,functions", NULL);
 	addTagRegex(language, "^[ \t]*(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=",
_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to