Implement CHARLEN and CHARSUB

Fixes #786
This commit is contained in:
Rangi
2021-03-08 15:11:12 -05:00
committed by Rangi
parent d43408f4f3
commit 2005ed1df9
10 changed files with 120 additions and 32 deletions

View File

@@ -210,6 +210,9 @@ static struct KeywordMapping {
{"STRRPL", T_OP_STRRPL},
{"STRFMT", T_OP_STRFMT},
{"CHARLEN", T_OP_CHARLEN},
{"CHARSUB", T_OP_CHARSUB},
{"INCLUDE", T_POP_INCLUDE},
{"PRINT", T_POP_PRINT},
{"PRINTLN", T_POP_PRINTLN},
@@ -589,7 +592,7 @@ struct KeywordDictNode {
uint16_t children[0x60 - ' '];
struct KeywordMapping const *keyword;
/* Since the keyword structure is invariant, the min number of nodes is known at compile time */
} keywordDict[351] = {0}; /* Make sure to keep this correct when adding keywords! */
} keywordDict[357] = {0}; /* Make sure to keep this correct when adding keywords! */
/* Convert a char into its index into the dict */
static uint8_t dictIndex(char c)