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 mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany