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,
tCELLSOF,
tCHAR,
tCLASS,
tCONST,
tCONTINUE,
tDECL,

View File

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

View File

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

View File

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