aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Lockwood2021-07-09 19:23:18 -0600
committerAlexis Lockwood2021-07-09 19:23:18 -0600
commit0fc8a1562e17aa38873a57250d3e4a227a87f681 (patch)
tree6b203352ddf694099f62f02eeaf0cce286244c12
parent53d0f8e7ab35013cc400fb5b5d905d4d655930d3 (diff)
Ignore the generated files
-rw-r--r--.gitignore2
-rw-r--r--lib/ls_kws.c227
-rw-r--r--lib/ls_kws.h122
3 files changed, 2 insertions, 349 deletions
diff --git a/.gitignore b/.gitignore
index 1c36585..758514b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
*.test
ls_run
ls_minify
+lib/ls_kws.c
+lib/ls_kws.h
diff --git a/lib/ls_kws.c b/lib/ls_kws.c
deleted file mode 100644
index 6b8d3e7..0000000
--- a/lib/ls_kws.c
+++ /dev/null
@@ -1,227 +0,0 @@
-// This code was generated by gen_kws.py at Fri 09 Jul 2021 07:16:09 PM MDT
-#include "ls_internal.h"
-
-const LS_PROGMEM uint8_t ls_kw_hashmap_indices[] = {
- /* 0 */ 0,
- /* 1 */ 2,
- /* 2 */ 3,
- /* 3 */ 5,
- /* 4 */ 9,
- /* 5 */ 12,
- /* 6 */ 15,
- /* 7 */ 17,
- /* 8 */ LS_HASHMAP_NULL_VALUE,
- /* 9 */ 18,
- /* 10 */ 21,
- /* 11 */ 23,
- /* 12 */ 25,
- /* 13 */ 28,
- /* 14 */ 29,
- /* 15 */ 30,
- /* 16 */ 33,
- /* 17 */ 35,
- /* 18 */ 36,
- /* 19 */ 37,
- /* 20 */ 38,
- /* 21 */ 40,
- /* 22 */ 41,
- /* 23 */ 44,
- /* 24 */ 46,
- /* 25 */ 47,
- /* 26 */ 50,
- /* 27 */ 52,
- /* 28 */ 53,
- /* 29 */ 56,
- /* 30 */ 58,
- /* 31 */ 59,
-};
-
-const LS_PROGMEM uint8_t ls_kw_hashmap[] = {
- /* 0 */ 22,
- /* 1 */ 0x80 | 44,
- /* 2 */ 0x80 | 36,
- /* 3 */ 30,
- /* 4 */ 0x80 | 54,
- /* 5 */ 5,
- /* 6 */ 51,
- /* 7 */ 53,
- /* 8 */ 0x80 | 56,
- /* 9 */ 42,
- /* 10 */ 43,
- /* 11 */ 0x80 | 46,
- /* 12 */ 10,
- /* 13 */ 24,
- /* 14 */ 0x80 | 29,
- /* 15 */ 26,
- /* 16 */ 0x80 | 34,
- /* 17 */ 0x80 | 21,
- /* 18 */ 11,
- /* 19 */ 15,
- /* 20 */ 0x80 | 40,
- /* 21 */ 19,
- /* 22 */ 0x80 | 47,
- /* 23 */ 28,
- /* 24 */ 0x80 | 59,
- /* 25 */ 13,
- /* 26 */ 17,
- /* 27 */ 0x80 | 55,
- /* 28 */ 0x80 | 39,
- /* 29 */ 0x80 | 57,
- /* 30 */ 14,
- /* 31 */ 25,
- /* 32 */ 0x80 | 52,
- /* 33 */ 18,
- /* 34 */ 0x80 | 27,
- /* 35 */ 0x80 | 33,
- /* 36 */ 0x80 | 37,
- /* 37 */ 0x80 | 1,
- /* 38 */ 2,
- /* 39 */ 0x80 | 20,
- /* 40 */ 0x80 | 4,
- /* 41 */ 0,
- /* 42 */ 9,
- /* 43 */ 0x80 | 48,
- /* 44 */ 3,
- /* 45 */ 0x80 | 16,
- /* 46 */ 0x80 | 7,
- /* 47 */ 23,
- /* 48 */ 58,
- /* 49 */ 0x80 | 60,
- /* 50 */ 12,
- /* 51 */ 0x80 | 31,
- /* 52 */ 0x80 | 50,
- /* 53 */ 6,
- /* 54 */ 41,
- /* 55 */ 0x80 | 49,
- /* 56 */ 8,
- /* 57 */ 0x80 | 35,
- /* 58 */ 0x80 | 45,
- /* 59 */ 32,
- /* 60 */ 0x80 | 38,
-};
-
-static const LS_PROGMEM char _kw_name_ABS[] = "ABS";
-static const LS_PROGMEM char _kw_name_AND[] = "AND";
-static const LS_PROGMEM char _kw_name_AS[] = "AS";
-static const LS_PROGMEM char _kw_name_ASC[] = "ASC";
-static const LS_PROGMEM char _kw_name_AT[] = "AT";
-static const LS_PROGMEM char _kw_name_ATN[] = "ATN";
-static const LS_PROGMEM char _kw_name_CALL[] = "CALL";
-static const LS_PROGMEM char _kw_name_CAT[] = "CAT";
-static const LS_PROGMEM char _kw_name_CHR[] = "CHR";
-static const LS_PROGMEM char _kw_name_CLOSE[] = "CLOSE";
-static const LS_PROGMEM char _kw_name_COS[] = "COS";
-static const LS_PROGMEM char _kw_name_COUNT[] = "COUNT";
-static const LS_PROGMEM char _kw_name_DATA[] = "DATA";
-static const LS_PROGMEM char _kw_name_DEC[] = "DEC";
-static const LS_PROGMEM char _kw_name_DEF[] = "DEF";
-static const LS_PROGMEM char _kw_name_ELSE[] = "ELSE";
-static const LS_PROGMEM char _kw_name_END[] = "END";
-static const LS_PROGMEM char _kw_name_EQV[] = "EQV";
-static const LS_PROGMEM char _kw_name_ERASE[] = "ERASE";
-static const LS_PROGMEM char _kw_name_ERROR[] = "ERROR";
-static const LS_PROGMEM char _kw_name_FN[] = "FN";
-static const LS_PROGMEM char _kw_name_FOR[] = "FOR";
-static const LS_PROGMEM char _kw_name_GOSUB[] = "GOSUB";
-static const LS_PROGMEM char _kw_name_GOTO[] = "GOTO";
-static const LS_PROGMEM char _kw_name_HEX[] = "HEX";
-static const LS_PROGMEM char _kw_name_IF[] = "IF";
-static const LS_PROGMEM char _kw_name_IMP[] = "IMP";
-static const LS_PROGMEM char _kw_name_INPUT[] = "INPUT";
-static const LS_PROGMEM char _kw_name_LEFT[] = "LEFT";
-static const LS_PROGMEM char _kw_name_LET[] = "LET";
-static const LS_PROGMEM char _kw_name_LOG[] = "LOG";
-static const LS_PROGMEM char _kw_name_MID[] = "MID";
-static const LS_PROGMEM char _kw_name_NEXT[] = "NEXT";
-static const LS_PROGMEM char _kw_name_NOT[] = "NOT";
-static const LS_PROGMEM char _kw_name_OCT[] = "OCT";
-static const LS_PROGMEM char _kw_name_ON[] = "ON";
-static const LS_PROGMEM char _kw_name_OR[] = "OR";
-static const LS_PROGMEM char _kw_name_OPEN[] = "OPEN";
-static const LS_PROGMEM char _kw_name_PACK[] = "PACK";
-static const LS_PROGMEM char _kw_name_PRINT[] = "PRINT";
-static const LS_PROGMEM char _kw_name_RANDOMIZE[] = "RANDOMIZE";
-static const LS_PROGMEM char _kw_name_READ[] = "READ";
-static const LS_PROGMEM char _kw_name_REM[] = "REM";
-static const LS_PROGMEM char _kw_name_RESTORE[] = "RESTORE";
-static const LS_PROGMEM char _kw_name_RETURN[] = "RETURN";
-static const LS_PROGMEM char _kw_name_RIGHT[] = "RIGHT";
-static const LS_PROGMEM char _kw_name_RND[] = "RND";
-static const LS_PROGMEM char _kw_name_SIN[] = "SIN";
-static const LS_PROGMEM char _kw_name_SQR[] = "SQR";
-static const LS_PROGMEM char _kw_name_STEP[] = "STEP";
-static const LS_PROGMEM char _kw_name_SWAP[] = "SWAP";
-static const LS_PROGMEM char _kw_name_TAN[] = "TAN";
-static const LS_PROGMEM char _kw_name_THEN[] = "THEN";
-static const LS_PROGMEM char _kw_name_TO[] = "TO";
-static const LS_PROGMEM char _kw_name_UNPACK[] = "UNPACK";
-static const LS_PROGMEM char _kw_name_UNTIL[] = "UNTIL";
-static const LS_PROGMEM char _kw_name_VAL[] = "VAL";
-static const LS_PROGMEM char _kw_name_WEND[] = "WEND";
-static const LS_PROGMEM char _kw_name_WHILE[] = "WHILE";
-static const LS_PROGMEM char _kw_name_WRITE[] = "WRITE";
-static const LS_PROGMEM char _kw_name_XOR[] = "XOR";
-
-const LS_PROGMEM ls_kwdef_t ls_kwmap[] = {
- /* 0 */ {_kw_name_ABS, NULL, KWDEF_FLAG_OP(LS_OP_ABS)|KWDEF_FLAG_NOEXEC },
- /* 1 */ {_kw_name_AND, NULL, KWDEF_FLAG_OP(LS_OP_AND)|KWDEF_FLAG_NOEXEC },
- /* 2 */ {_kw_name_AS, NULL, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_NOEXEC },
- /* 3 */ {_kw_name_ASC, ls_kw_fun_ASC, KWDEF_FLAG_NOT_OP },
- /* 4 */ {_kw_name_AT, NULL, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_NOEXEC },
- /* 5 */ {_kw_name_ATN, ls_kw_fun_ATN, KWDEF_FLAG_NOT_OP },
- /* 6 */ {_kw_name_CALL, ls_kw_fun_CALL, KWDEF_FLAG_NOT_OP },
- /* 7 */ {_kw_name_CAT, ls_kw_fun_CAT, KWDEF_FLAG_NOT_OP },
- /* 8 */ {_kw_name_CHR, ls_kw_fun_CHR, KWDEF_FLAG_NOT_OP },
- /* 9 */ {_kw_name_CLOSE, ls_kw_fun_CLOSE, KWDEF_FLAG_NOT_OP },
- /* 10 */ {_kw_name_COS, ls_kw_fun_COS, KWDEF_FLAG_NOT_OP },
- /* 11 */ {_kw_name_COUNT, ls_kw_fun_COUNT, KWDEF_FLAG_NOT_OP },
- /* 12 */ {_kw_name_DATA, ls_kw_fun_DATA, KWDEF_FLAG_NOT_OP },
- /* 13 */ {_kw_name_DEC, ls_kw_fun_DEC, KWDEF_FLAG_NOT_OP },
- /* 14 */ {_kw_name_DEF, ls_kw_fun_DEF, KWDEF_FLAG_NOT_OP },
- /* 15 */ {_kw_name_ELSE, ls_kw_fun_ELSE, KWDEF_FLAG_NOT_OP },
- /* 16 */ {_kw_name_END, ls_kw_fun_END, KWDEF_FLAG_NOT_OP },
- /* 17 */ {_kw_name_EQV, NULL, KWDEF_FLAG_OP(LS_OP_EQV)|KWDEF_FLAG_NOEXEC },
- /* 18 */ {_kw_name_ERASE, ls_kw_fun_ERASE, KWDEF_FLAG_NOT_OP },
- /* 19 */ {_kw_name_ERROR, ls_kw_fun_ERROR, KWDEF_FLAG_NOT_OP },
- /* 20 */ {_kw_name_FN, ls_kw_fun_FN, KWDEF_FLAG_NOT_OP },
- /* 21 */ {_kw_name_FOR, ls_kw_fun_FOR, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_SCANNING },
- /* 22 */ {_kw_name_GOSUB, ls_kw_fun_GOSUB, KWDEF_FLAG_NOT_OP },
- /* 23 */ {_kw_name_GOTO, ls_kw_fun_GOTO, KWDEF_FLAG_NOT_OP },
- /* 24 */ {_kw_name_HEX, ls_kw_fun_HEX, KWDEF_FLAG_NOT_OP },
- /* 25 */ {_kw_name_IF, ls_kw_fun_IF, KWDEF_FLAG_NOT_OP },
- /* 26 */ {_kw_name_IMP, NULL, KWDEF_FLAG_OP(LS_OP_IMP)|KWDEF_FLAG_NOEXEC },
- /* 27 */ {_kw_name_INPUT, ls_kw_fun_INPUT, KWDEF_FLAG_NOT_OP },
- /* 28 */ {_kw_name_LEFT, ls_kw_fun_LEFT, KWDEF_FLAG_NOT_OP },
- /* 29 */ {_kw_name_LET, ls_kw_fun_LET, KWDEF_FLAG_NOT_OP },
- /* 30 */ {_kw_name_LOG, ls_kw_fun_LOG, KWDEF_FLAG_NOT_OP },
- /* 31 */ {_kw_name_MID, ls_kw_fun_MID, KWDEF_FLAG_NOT_OP },
- /* 32 */ {_kw_name_NEXT, ls_kw_fun_NEXT, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_SCANNING },
- /* 33 */ {_kw_name_NOT, NULL, KWDEF_FLAG_OP(LS_OP_NOT)|KWDEF_FLAG_NOEXEC },
- /* 34 */ {_kw_name_OCT, ls_kw_fun_OCT, KWDEF_FLAG_NOT_OP },
- /* 35 */ {_kw_name_ON, ls_kw_fun_ON, KWDEF_FLAG_NOT_OP },
- /* 36 */ {_kw_name_OR, NULL, KWDEF_FLAG_OP(LS_OP_OR)|KWDEF_FLAG_NOEXEC },
- /* 37 */ {_kw_name_OPEN, ls_kw_fun_OPEN, KWDEF_FLAG_NOT_OP },
- /* 38 */ {_kw_name_PACK, ls_kw_fun_PACK, KWDEF_FLAG_NOT_OP },
- /* 39 */ {_kw_name_PRINT, ls_kw_fun_PRINT, KWDEF_FLAG_NOT_OP },
- /* 40 */ {_kw_name_RANDOMIZE, ls_kw_fun_RANDOMIZE, KWDEF_FLAG_NOT_OP },
- /* 41 */ {_kw_name_READ, ls_kw_fun_READ, KWDEF_FLAG_NOT_OP },
- /* 42 */ {_kw_name_REM, ls_kw_fun_REM, KWDEF_FLAG_NOT_OP },
- /* 43 */ {_kw_name_RESTORE, ls_kw_fun_RESTORE, KWDEF_FLAG_NOT_OP },
- /* 44 */ {_kw_name_RETURN, ls_kw_fun_RETURN, KWDEF_FLAG_NOT_OP },
- /* 45 */ {_kw_name_RIGHT, ls_kw_fun_RIGHT, KWDEF_FLAG_NOT_OP },
- /* 46 */ {_kw_name_RND, ls_kw_fun_RND, KWDEF_FLAG_NOT_OP },
- /* 47 */ {_kw_name_SIN, ls_kw_fun_SIN, KWDEF_FLAG_NOT_OP },
- /* 48 */ {_kw_name_SQR, ls_kw_fun_SQR, KWDEF_FLAG_NOT_OP },
- /* 49 */ {_kw_name_STEP, ls_kw_fun_STEP, KWDEF_FLAG_NOT_OP },
- /* 50 */ {_kw_name_SWAP, ls_kw_fun_SWAP, KWDEF_FLAG_NOT_OP },
- /* 51 */ {_kw_name_TAN, ls_kw_fun_TAN, KWDEF_FLAG_NOT_OP },
- /* 52 */ {_kw_name_THEN, NULL, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_NOEXEC },
- /* 53 */ {_kw_name_TO, NULL, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_NOEXEC },
- /* 54 */ {_kw_name_UNPACK, ls_kw_fun_UNPACK, KWDEF_FLAG_NOT_OP },
- /* 55 */ {_kw_name_UNTIL, NULL, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_NOEXEC },
- /* 56 */ {_kw_name_VAL, ls_kw_fun_VAL, KWDEF_FLAG_NOT_OP },
- /* 57 */ {_kw_name_WEND, ls_kw_fun_WEND, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_SCANNING },
- /* 58 */ {_kw_name_WHILE, ls_kw_fun_WHILE, KWDEF_FLAG_NOT_OP|KWDEF_FLAG_SCANNING },
- /* 59 */ {_kw_name_WRITE, ls_kw_fun_WRITE, KWDEF_FLAG_NOT_OP },
- /* 60 */ {_kw_name_XOR, NULL, KWDEF_FLAG_OP(LS_OP_XOR)|KWDEF_FLAG_NOEXEC },
-};
diff --git a/lib/ls_kws.h b/lib/ls_kws.h
deleted file mode 100644
index 2214d40..0000000
--- a/lib/ls_kws.h
+++ /dev/null
@@ -1,122 +0,0 @@
-// This code was generated by gen_kws.py at Fri 09 Jul 2021 07:16:09 PM MDT
-#ifndef LS_TYPES_H
-# error "ls_kws.h should not be included directly! Include ls_types.h instead."
-#endif
-#ifndef LS_KWS_H
-#define LS_KWS_H
-LS_KW_FUN(ASC);
-LS_KW_FUN(ATN);
-LS_KW_FUN(CALL);
-LS_KW_FUN(CAT);
-LS_KW_FUN(CHR);
-LS_KW_FUN(CLOSE);
-LS_KW_FUN(COS);
-LS_KW_FUN(COUNT);
-LS_KW_FUN(DATA);
-LS_KW_FUN(DEC);
-LS_KW_FUN(DEF);
-LS_KW_FUN(ELSE);
-LS_KW_FUN(END);
-LS_KW_FUN(ERASE);
-LS_KW_FUN(ERROR);
-LS_KW_FUN(FN);
-LS_KW_FUN(FOR);
-LS_KW_FUN(GOSUB);
-LS_KW_FUN(GOTO);
-LS_KW_FUN(HEX);
-LS_KW_FUN(IF);
-LS_KW_FUN(INPUT);
-LS_KW_FUN(LEFT);
-LS_KW_FUN(LET);
-LS_KW_FUN(LOG);
-LS_KW_FUN(MID);
-LS_KW_FUN(NEXT);
-LS_KW_FUN(OCT);
-LS_KW_FUN(ON);
-LS_KW_FUN(OPEN);
-LS_KW_FUN(PACK);
-LS_KW_FUN(PRINT);
-LS_KW_FUN(RANDOMIZE);
-LS_KW_FUN(READ);
-LS_KW_FUN(REM);
-LS_KW_FUN(RESTORE);
-LS_KW_FUN(RETURN);
-LS_KW_FUN(RIGHT);
-LS_KW_FUN(RND);
-LS_KW_FUN(SIN);
-LS_KW_FUN(SQR);
-LS_KW_FUN(STEP);
-LS_KW_FUN(SWAP);
-LS_KW_FUN(TAN);
-LS_KW_FUN(UNPACK);
-LS_KW_FUN(VAL);
-LS_KW_FUN(WEND);
-LS_KW_FUN(WHILE);
-LS_KW_FUN(WRITE);
-typedef enum {
- LS_KW_ABS = 0x80,
- LS_KW_AND = 0x81,
- LS_KW_AS = 0x82,
- LS_KW_ASC = 0x83,
- LS_KW_AT = 0x84,
- LS_KW_ATN = 0x85,
- LS_KW_CALL = 0x86,
- LS_KW_CAT = 0x87,
- LS_KW_CHR = 0x88,
- LS_KW_CLOSE = 0x89,
- LS_KW_COS = 0x8A,
- LS_KW_COUNT = 0x8B,
- LS_KW_DATA = 0x8C,
- LS_KW_DEC = 0x8D,
- LS_KW_DEF = 0x8E,
- LS_KW_ELSE = 0x8F,
- LS_KW_END = 0x90,
- LS_KW_EQV = 0x91,
- LS_KW_ERASE = 0x92,
- LS_KW_ERROR = 0x93,
- LS_KW_FN = 0x94,
- LS_KW_FOR = 0x95,
- LS_KW_GOSUB = 0x96,
- LS_KW_GOTO = 0x97,
- LS_KW_HEX = 0x98,
- LS_KW_IF = 0x99,
- LS_KW_IMP = 0x9A,
- LS_KW_INPUT = 0x9B,
- LS_KW_LEFT = 0x9C,
- LS_KW_LET = 0x9D,
- LS_KW_LOG = 0x9E,
- LS_KW_MID = 0x9F,
- LS_KW_NEXT = 0xA0,
- LS_KW_NOT = 0xA1,
- LS_KW_OCT = 0xA2,
- LS_KW_ON = 0xA3,
- LS_KW_OR = 0xA4,
- LS_KW_OPEN = 0xA5,
- LS_KW_PACK = 0xA6,
- LS_KW_PRINT = 0xA7,
- LS_KW_RANDOMIZE = 0xA8,
- LS_KW_READ = 0xA9,
- LS_KW_REM = 0xAA,
- LS_KW_RESTORE = 0xAB,
- LS_KW_RETURN = 0xAC,
- LS_KW_RIGHT = 0xAD,
- LS_KW_RND = 0xAE,
- LS_KW_SIN = 0xAF,
- LS_KW_SQR = 0xB0,
- LS_KW_STEP = 0xB1,
- LS_KW_SWAP = 0xB2,
- LS_KW_TAN = 0xB3,
- LS_KW_THEN = 0xB4,
- LS_KW_TO = 0xB5,
- LS_KW_UNPACK = 0xB6,
- LS_KW_UNTIL = 0xB7,
- LS_KW_VAL = 0xB8,
- LS_KW_WEND = 0xB9,
- LS_KW_WHILE = 0xBA,
- LS_KW_WRITE = 0xBB,
- LS_KW_XOR = 0xBC,
- LS_MAX_KWS
-} ls_kw_t;
-#define LS_NOT_A_KW LS_MAX_KWS
-#define LS_KW_OFFSET 0x80
-#endif // !defined(LS_INTERNAL_H)