diff --git a/sourcepawn/compiler/sc.h b/sourcepawn/compiler/sc.h index f1350e04..5c1af76c 100644 --- a/sourcepawn/compiler/sc.h +++ b/sourcepawn/compiler/sc.h @@ -395,7 +395,6 @@ enum { tCASE, tCELLSOF, tCHAR, - tCLASS, tCONST, tCONTINUE, tDECL, diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 593df220..5ff514de 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -1526,12 +1526,17 @@ static void parse(void) case 0: /* ignore zero's */ break; + case tSYMBOL: + if (strcmp(tok.str, "class") == 0) { + domethodmap(Layout_Class); + break; + } + // Fallthrough. case tINT: case tOBJECT: case tCHAR: case tVOID: case tLABEL: - case tSYMBOL: lexpush(); // Fallthrough. case tNEW: @@ -1563,9 +1568,6 @@ static void parse(void) case tMETHODMAP: domethodmap(Layout_MethodMap); break; - case tCLASS: - domethodmap(Layout_Class); - break; case '}': error(54); /* unmatched closing brace */ break; diff --git a/sourcepawn/compiler/sc2.c b/sourcepawn/compiler/sc2.c index b1ae61b9..bc86780b 100644 --- a/sourcepawn/compiler/sc2.c +++ b/sourcepawn/compiler/sc2.c @@ -1949,7 +1949,7 @@ char *sc_tokens[] = { "...", "..", "::", "assert", "*begin", "break", - "case", "cellsof", "char", "class", "const", "continue", + "case", "cellsof", "char", "const", "continue", "decl", "default", "defined", "delete", "do", "else", "*end", "enum", "exit", "for", "forward", "funcenum", "functag", "function", diff --git a/sourcepawn/compiler/tests/ok-class-arg.sp b/sourcepawn/compiler/tests/ok-class-arg.sp new file mode 100644 index 00000000..1454638c --- /dev/null +++ b/sourcepawn/compiler/tests/ok-class-arg.sp @@ -0,0 +1,7 @@ +f(const char[] class) +{ +} + +public OnPluginStart() +{ +}