--- php.c.ori 2006-07-27 16:43:22.000000000 +0200 +++ php.c 2006-07-27 16:44:11.000000000 +0200 @@ -57,6 +57,34 @@ return (boolean)(isVarChar1 (c) || isdigit (c)); } +static boolean isKeyword(const unsigned char *cp) { + if (((strncmp ((const char*) cp, "abstract", (size_t) 8) == 0) && + isspace ((int) cp [8]))) { + return 8; + } + + if (((strncmp ((const char*) cp, "public", (size_t) 6) == 0) && + isspace ((int) cp [6]))) { + return 6; + } + + if (((strncmp ((const char*) cp, "private", (size_t) 7) == 0) && + isspace ((int) cp [7]))) { + return 7; + } + + if (((strncmp ((const char*) cp, "protected", (size_t) 9) == 0) && + isspace ((int) cp [9]))) { + return 9; + } + + if (((strncmp ((const char*) cp, "static", (size_t) 6) == 0) && + isspace ((int) cp [6]))) { + return 6; + } + return 0; +} + static void findPhpTags (void) { vString *name = vStringNew (); @@ -69,6 +97,15 @@ while (isspace (*cp)) cp++; + + int cpa; + while (cpa = isKeyword(cp)) { + cp += cpa; + while (isspace (*cp)) + cp++; + } + + if (*(const char*)cp == '$' && isVarChar1 (*(const char*)(cp+1))) { cp += 1;