Revision: 2055 http://geany.svn.sourceforge.net/geany/?rev=2055&view=rev Author: eht16 Date: 2007-11-18 09:17:59 -0800 (Sun, 18 Nov 2007)
Log Message: ----------- Add missing symbol types: Interface and Constants for PHP. Disable use of non-ASCII characters for PHP parser, it caused problems when using with locales other than "C". Add missing line break characters in error messages in lregex.c.
Modified Paths: -------------- trunk/ChangeLog trunk/src/symbols.c trunk/tagmanager/lregex.c trunk/tagmanager/php.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-18 15:09:28 UTC (rev 2054) +++ trunk/ChangeLog 2007-11-18 17:17:59 UTC (rev 2055) @@ -4,6 +4,11 @@ src/prefs.h, src/treeviews.c: Add hidden pref to hide symbol list treeview expander (GTK >= 2.12). Double click on symbol list sections now expands/collapses them. + * src/symbols.c, tagmanager/lregex.c, tagmanager/php.c: + Add missing symbol types: Interface and Constants for PHP. + Disable use of non-ASCII characters for PHP parser, it caused + problems when using with locales other than "C". + Add missing line break characters in error messages in lregex.c.
2007-11-17 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/symbols.c =================================================================== --- trunk/src/symbols.c 2007-11-18 15:09:28 UTC (rev 2054) +++ trunk/src/symbols.c 2007-11-18 17:17:59 UTC (rev 2055) @@ -573,9 +573,10 @@ case GEANY_FILETYPES_PHP: { tag_list_add_groups(tag_store, + &(tv_iters.tag_struct), _("Interfaces"), "classviewer-struct", &(tv_iters.tag_class), _("Classes"), "classviewer-class", &(tv_iters.tag_function), _("Functions"), "classviewer-method", - &(tv_iters.tag_macro), _("Constants"), NULL, + &(tv_iters.tag_macro), _("Constants"), "classviewer-macro", &(tv_iters.tag_variable), _("Variables"), "classviewer-var", NULL); //&(tv_iters.tag_struct), _("Label"), @@ -640,7 +641,7 @@ { tag_list_add_groups(tag_store, &(tv_iters.tag_namespace), _("Package"), NULL, - &(tv_iters.tag_struct), _("Interfaces"), NULL, + &(tv_iters.tag_struct), _("Interfaces"), "classviewer-struct", &(tv_iters.tag_class), _("Classes"), "classviewer-class", &(tv_iters.tag_function), _("Methods"), "classviewer-method", &(tv_iters.tag_member), _("Members"), "classviewer-member", @@ -656,7 +657,7 @@ &(tv_iters.tag_struct), _("Interfaces"), "classviewer-struct", &(tv_iters.tag_class), _("Classes"), "classviewer-class", &(tv_iters.tag_function), _("Methods"), "classviewer-method", - &(tv_iters.tag_type), _("Types"), NULL, + &(tv_iters.tag_type), _("Types"), "classviewer-macro", &(tv_iters.tag_variable), _("Variables"), "classviewer-var", &(tv_iters.tag_other), _("Other"), "classviewer-other", NULL);
Modified: trunk/tagmanager/lregex.c =================================================================== --- trunk/tagmanager/lregex.c 2007-11-18 15:09:28 UTC (rev 2054) +++ trunk/tagmanager/lregex.c 2007-11-18 17:17:59 UTC (rev 2055) @@ -217,18 +217,18 @@
*name = scanSeparators (regexp); if (*regexp == '\0') - printf ("regex: empty regexp"); + printf ("regex: empty regexp\n"); else if (**name != separator) - printf ("regex: %s: incomplete regexp", regexp); + printf ("regex: %s: incomplete regexp\n", regexp); else { char* const third = scanSeparators (*name); if (**name == '\0') - printf ("regex: %s: regexp missing name pattern", regexp); + printf ("regex: %s: regexp missing name pattern\n", regexp); if ((*name) [strlen (*name) - 1] == '\') - printf ("regex: error in name pattern: "%s"", *name); + printf ("regex: error in name pattern: "%s"\n", *name); if (*third != separator) - printf ("regex: %s: regexp missing final separator", regexp); + printf ("regex: %s: regexp missing final separator\n", regexp); else { char* const fourth = scanSeparators (third); @@ -323,7 +323,7 @@ case 'b': cflags &= ~REG_EXTENDED; break; case 'e': cflags |= REG_EXTENDED; break; case 'i': cflags |= REG_ICASE; break; - default: printf ("regex: unknown regex flag: '%c'", *flags); break; + default: printf ("regex: unknown regex flag: '%c'\n", *flags); break; } } result = xMalloc (1, regex_t); @@ -332,7 +332,7 @@ { char errmsg[256]; regerror (errcode, result, errmsg, 256); - printf ("regex: regcomp %s: %s", regexp, errmsg); + printf ("regex: regcomp %s: %s\n", regexp, errmsg); regfree (result); eFree (result); result = NULL; @@ -402,13 +402,13 @@ else if (parameter [0] != '@') addLanguageRegex (language, parameter); else if (! doesFileExist (parameter + 1)) - printf ("regex: cannot open regex file"); + printf ("regex: cannot open regex file\n"); else { const char* regexfile = parameter + 1; FILE* const fp = fopen (regexfile, "r"); if (fp == NULL) - printf ("regex: %s", regexfile); + printf ("regex: %s\n", regexfile); else { vString* const regex = vStringNew (); @@ -612,11 +612,11 @@ langType language; language = getNamedLanguage (dash + 1); if (language == LANG_IGNORE) - printf ("regex: unknown language "%s" in --%s option", (dash + 1), option); + printf ("regex: unknown language "%s" in --%s option\n", (dash + 1), option); else processLanguageRegex (language, parameter); #else - printf ("regex: regex support not available; required for --%s option", + printf ("regex: regex support not available; required for --%s option\n", option); #endif handled = TRUE;
Modified: trunk/tagmanager/php.c =================================================================== --- trunk/tagmanager/php.c 2007-11-18 15:09:28 UTC (rev 2054) +++ trunk/tagmanager/php.c 2007-11-18 17:17:59 UTC (rev 2055) @@ -54,6 +54,7 @@ * end of an identifier, and we need something like iconv to take into * account the user's locale (or an override on the command-line.) */ +/* #ifdef __CYGWIN__ #define ALPHA "[:alpha:]" #define ALNUM "[:alnum:]" @@ -61,7 +62,12 @@ #define ALPHA "A-Za-z\x7f-\xff" #define ALNUM "0-9A-Za-z\x7f-\xff" #endif +*/ +// eht16 - "A-Za-z\x7f-\xff" fails on other locales than "C" and so skip it +#define ALPHA "[:alpha:]" +#define ALNUM "[:alnum:]"
+ static void installPHPRegex (const langType language) { addTagRegex(language, "(^|[ \t])class[ \t]+([" ALPHA "_][" ALNUM "_]*)", @@ -69,7 +75,7 @@ addTagRegex(language, "(^|[ \t])interface[ \t]+([" ALPHA "_][" ALNUM "_]*)", "\2", "i,interface,interfaces", NULL); addTagRegex(language, "(^|[ \t])define[ \t]*\([ \t]*['"]?([" ALPHA "_][" ALNUM "_]*)", - "\2", "d,define,constant definitions", NULL); + "\2", "d,macro,constant definitions", NULL); addTagRegex(language, "(^|[ \t])function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)", "\2", "f,function,functions", NULL); addTagRegex(language, "(^|[ \t])(\$|::\$|\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=", @@ -159,7 +165,7 @@ cp++;
while (isspace ((int) *cp)) - ++cp; + ++cp; }
vStringClear (name); @@ -171,7 +177,7 @@ vStringTerminate (name); makeSimpleTag (name, PhpKinds, K_FUNCTION); vStringClear (name); - } + } else if (strncmp ((const char*) cp, "class", (size_t) 5) == 0 && isspace ((int) cp [5])) { @@ -206,7 +212,7 @@ ++cp; else if (! ((*cp == '_') || isalnum ((int) *cp))) continue; - + vStringClear (name); while (isalnum ((int) *cp) || *cp == '_') {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.