Lines 38-43
Link Here
|
38 |
{ TRUE, 'v', "variable", "variables" } |
38 |
{ TRUE, 'v', "variable", "variables" } |
39 |
}; |
39 |
}; |
40 |
|
40 |
|
|
|
41 |
static const unsigned char *keywords[] = { |
42 |
"abstract", |
43 |
"public", |
44 |
"private", |
45 |
"protected", |
46 |
"static", |
47 |
"final", |
48 |
NULL |
49 |
}; |
50 |
|
41 |
/* |
51 |
/* |
42 |
* FUNCTION DEFINITIONS |
52 |
* FUNCTION DEFINITIONS |
43 |
*/ |
53 |
*/ |
Lines 57-65
Link Here
|
57 |
return (boolean)(isVarChar1 (c) || isdigit (c)); |
67 |
return (boolean)(isVarChar1 (c) || isdigit (c)); |
58 |
} |
68 |
} |
59 |
|
69 |
|
|
|
70 |
static boolean isKeyword(const unsigned char *cp) { |
71 |
int i=0; |
72 |
size_t sl; |
73 |
unsigned const char *kw; |
74 |
|
75 |
while (kw = keywords[i++]) { |
76 |
sl = strlen(kw); |
77 |
if (strncmp(cp, kw, sl)==0 && isspace(cp[sl])) { |
78 |
return sl; |
79 |
} |
80 |
} |
81 |
return 0; |
82 |
} |
83 |
|
60 |
static void findPhpTags (void) |
84 |
static void findPhpTags (void) |
61 |
{ |
85 |
{ |
62 |
vString *name = vStringNew (); |
86 |
vString *name = vStringNew (); |
|
|
87 |
int cpa; |
63 |
const unsigned char *line; |
88 |
const unsigned char *line; |
64 |
|
89 |
|
65 |
while ((line = fileReadLine ()) != NULL) |
90 |
while ((line = fileReadLine ()) != NULL) |
Lines 69-74
Link Here
|
69 |
while (isspace (*cp)) |
94 |
while (isspace (*cp)) |
70 |
cp++; |
95 |
cp++; |
71 |
|
96 |
|
|
|
97 |
while (cpa = isKeyword(cp)) { |
98 |
cp += cpa; |
99 |
while (isspace (*cp)) |
100 |
cp++; |
101 |
} |
102 |
|
103 |
|
72 |
if (*(const char*)cp == '$' && isVarChar1 (*(const char*)(cp+1))) |
104 |
if (*(const char*)cp == '$' && isVarChar1 (*(const char*)(cp+1))) |
73 |
{ |
105 |
{ |
74 |
cp += 1; |
106 |
cp += 1; |