changed class -> proto

This commit is contained in:
2020-12-05 17:58:56 -06:00
parent e0d51c191f
commit 9ca67c8408
8 changed files with 13 additions and 13 deletions

View File

@@ -5,7 +5,6 @@
CReservedWord reservedWords[] = {
{TOKEN_AND, "and", 3},
{TOKEN_CLASS, "class", 5},
{TOKEN_DO, "do", 2},
{TOKEN_ELSE, "else", 4},
{TOKEN_ELSEIF, "elseif", 6},
@@ -18,6 +17,7 @@ CReservedWord reservedWords[] = {
{TOKEN_NIL, "nil", 3},
{TOKEN_NOT, "not", 3},
{TOKEN_OR, "or", 2},
{TOKEN_PROTO, "proto", 5},
{TOKEN_RETURN, "return", 6},
{TOKEN_THEN, "then", 4},
{TOKEN_TRUE, "true", 4},

View File

@@ -49,7 +49,7 @@ typedef enum {
TOKEN_END,
TOKEN_FOR,
TOKEN_FUNCTION,
TOKEN_CLASS,
TOKEN_PROTO,
TOKEN_IF,
TOKEN_LOCAL,
TOKEN_NOT,

View File

@@ -742,7 +742,7 @@ ParseRule ruleTable[] = {
[TOKEN_END] = {NULL, NULL, PREC_NONE},
[TOKEN_FOR] = {NULL, NULL, PREC_NONE},
[TOKEN_FUNCTION] = {anonFunction, NULL, PREC_NONE},
[TOKEN_CLASS] = {NULL, NULL, PREC_NONE},
[TOKEN_PROTO] = {NULL, NULL, PREC_NONE},
[TOKEN_IF] = {NULL, NULL, PREC_NONE},
[TOKEN_LOCAL] = {NULL, NULL, PREC_NONE},
[TOKEN_NOT] = {NULL, NULL, PREC_NONE},
@@ -828,7 +828,7 @@ static void defineVariable(CParseState *pstate, uint16_t global, bool forceLocal
valuePopped(pstate, 1);
}
static void _class(CParseState *pstate) {
static void _proto(CParseState *pstate) {
uint16_t var = parseVariable(pstate, "Expected identifer!", false);
int entries = 0;
@@ -1156,8 +1156,8 @@ static void expressionStatement(CParseState *pstate) {
forLoop(pstate);
} else if (match(pstate, TOKEN_FUNCTION)) {
functionDeclaration(pstate);
} else if (match(pstate, TOKEN_CLASS)) {
_class(pstate);
} else if (match(pstate, TOKEN_PROTO)) {
_proto(pstate);
} else if (match(pstate, TOKEN_RETURN)) {
returnStatement(pstate);
} else {