From b30a092ab85aad753c9a68344914f81304865135 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 27 Oct 2024 18:07:52 +1100 Subject: [PATCH] Added more reserved words --- source/toy_lexer.c | 6 +++--- source/toy_parser.c | 2 +- source/toy_token_types.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/toy_lexer.c b/source/toy_lexer.c index 3520bb3..4b1ef73 100644 --- a/source/toy_lexer.c +++ b/source/toy_lexer.c @@ -21,9 +21,9 @@ const Toy_KeywordTypeTuple keywordTuples[] = { {TOY_TOKEN_TYPE_INTEGER, "int"}, {TOY_TOKEN_TYPE_FLOAT, "float"}, {TOY_TOKEN_TYPE_STRING, "string"}, - // TOY_TOKEN_TYPE_ARRAY, - // TOY_TOKEN_TYPE_DICTIONARY, - // TOY_TOKEN_TYPE_FUNCTION, + {TOY_TOKEN_TYPE_ARRAY, "array"}, + {TOY_TOKEN_TYPE_TABLE, "table"}, + {TOY_TOKEN_TYPE_FUNCTION, "function"}, //TODO: type?? {TOY_TOKEN_TYPE_OPAQUE, "opaque"}, {TOY_TOKEN_TYPE_ANY, "any"}, diff --git a/source/toy_parser.c b/source/toy_parser.c index af75685..47901ff 100644 --- a/source/toy_parser.c +++ b/source/toy_parser.c @@ -130,7 +130,7 @@ static ParsingTuple parsingRulesetTable[] = { {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_FLOAT, {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_STRING, {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_ARRAY, - {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_DICTIONARY, + {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_TABLE, {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_FUNCTION, {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_OPAQUE, {PREC_NONE,NULL,NULL},// TOY_TOKEN_TYPE_ANY, diff --git a/source/toy_token_types.h b/source/toy_token_types.h index 2ee5862..26abf16 100644 --- a/source/toy_token_types.h +++ b/source/toy_token_types.h @@ -15,7 +15,7 @@ typedef enum Toy_TokenType { TOY_TOKEN_TYPE_FLOAT, TOY_TOKEN_TYPE_STRING, TOY_TOKEN_TYPE_ARRAY, - TOY_TOKEN_TYPE_DICTIONARY, + TOY_TOKEN_TYPE_TABLE, TOY_TOKEN_TYPE_FUNCTION, TOY_TOKEN_TYPE_OPAQUE, TOY_TOKEN_TYPE_ANY,