--- php.c.orig 2006-05-10 14:38:20.000000000 +0400 +++ php.c 2006-05-10 14:41:38.000000000 +0400 @@ -38,6 +38,16 @@ { TRUE, 'v', "variable", "variables" } }; +static const unsigned char *keywords[] = { +"abstract", +"public", +"private", +"protected", +"static", +"final", +NULL +}; + /* * FUNCTION DEFINITIONS */ @@ -57,9 +67,24 @@ return (boolean)(isVarChar1 (c) || isdigit (c)); } +static boolean isKeyword(const unsigned char *cp) { + int i=0; + size_t sl; + unsigned const char *kw; + + while (kw = keywords[i++]) { + sl = strlen(kw); + if (strncmp(cp, kw, sl)==0 && isspace(cp[sl])) { + return sl; + } + } + return 0; +} + static void findPhpTags (void) { vString *name = vStringNew (); + int cpa; const unsigned char *line; while ((line = fileReadLine ()) != NULL) @@ -69,6 +94,13 @@ while (isspace (*cp)) cp++; + while (cpa = isKeyword(cp)) { + cp += cpa; + while (isspace (*cp)) + cp++; + } + + if (*(const char*)cp == '$' && isVarChar1 (*(const char*)(cp+1))) { cp += 1;