Unkeyword "class", make it contextual.
This commit is contained in:
parent
d2b7126e1d
commit
02b7f42811
@ -395,7 +395,6 @@ enum {
|
|||||||
tCASE,
|
tCASE,
|
||||||
tCELLSOF,
|
tCELLSOF,
|
||||||
tCHAR,
|
tCHAR,
|
||||||
tCLASS,
|
|
||||||
tCONST,
|
tCONST,
|
||||||
tCONTINUE,
|
tCONTINUE,
|
||||||
tDECL,
|
tDECL,
|
||||||
|
@ -1526,12 +1526,17 @@ static void parse(void)
|
|||||||
case 0:
|
case 0:
|
||||||
/* ignore zero's */
|
/* ignore zero's */
|
||||||
break;
|
break;
|
||||||
|
case tSYMBOL:
|
||||||
|
if (strcmp(tok.str, "class") == 0) {
|
||||||
|
domethodmap(Layout_Class);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Fallthrough.
|
||||||
case tINT:
|
case tINT:
|
||||||
case tOBJECT:
|
case tOBJECT:
|
||||||
case tCHAR:
|
case tCHAR:
|
||||||
case tVOID:
|
case tVOID:
|
||||||
case tLABEL:
|
case tLABEL:
|
||||||
case tSYMBOL:
|
|
||||||
lexpush();
|
lexpush();
|
||||||
// Fallthrough.
|
// Fallthrough.
|
||||||
case tNEW:
|
case tNEW:
|
||||||
@ -1563,9 +1568,6 @@ static void parse(void)
|
|||||||
case tMETHODMAP:
|
case tMETHODMAP:
|
||||||
domethodmap(Layout_MethodMap);
|
domethodmap(Layout_MethodMap);
|
||||||
break;
|
break;
|
||||||
case tCLASS:
|
|
||||||
domethodmap(Layout_Class);
|
|
||||||
break;
|
|
||||||
case '}':
|
case '}':
|
||||||
error(54); /* unmatched closing brace */
|
error(54); /* unmatched closing brace */
|
||||||
break;
|
break;
|
||||||
|
@ -1949,7 +1949,7 @@ char *sc_tokens[] = {
|
|||||||
"...", "..", "::",
|
"...", "..", "::",
|
||||||
"assert",
|
"assert",
|
||||||
"*begin", "break",
|
"*begin", "break",
|
||||||
"case", "cellsof", "char", "class", "const", "continue",
|
"case", "cellsof", "char", "const", "continue",
|
||||||
"decl", "default", "defined", "delete", "do",
|
"decl", "default", "defined", "delete", "do",
|
||||||
"else", "*end", "enum", "exit",
|
"else", "*end", "enum", "exit",
|
||||||
"for", "forward", "funcenum", "functag", "function",
|
"for", "forward", "funcenum", "functag", "function",
|
||||||
|
7
sourcepawn/compiler/tests/ok-class-arg.sp
Normal file
7
sourcepawn/compiler/tests/ok-class-arg.sp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
f(const char[] class)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public OnPluginStart()
|
||||||
|
{
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user