Unkeyword "class", make it contextual.

This commit is contained in:
David Anderson 2014-07-08 00:43:46 -07:00
parent d2b7126e1d
commit 02b7f42811
4 changed files with 14 additions and 6 deletions

View File

@ -395,7 +395,6 @@ enum {
tCASE, tCASE,
tCELLSOF, tCELLSOF,
tCHAR, tCHAR,
tCLASS,
tCONST, tCONST,
tCONTINUE, tCONTINUE,
tDECL, tDECL,

View File

@ -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;

View File

@ -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",

View File

@ -0,0 +1,7 @@
f(const char[] class)
{
}
public OnPluginStart()
{
}