extended lexer, fixed table shrinking

This commit is contained in:
2020-11-25 23:34:02 -06:00
parent bb11b3b309
commit 0745fd10a9
6 changed files with 78 additions and 7 deletions

View File

@@ -78,10 +78,14 @@ typedef struct {
typedef struct {
char *currentChar;
char *startChar;
char *buffer; // if non-NULL & bufCount > 0, token->start & token->length will be set to buffer & bufCount respectively
size_t bufCount;
size_t bufCap;
int line; // current line
int lastLine; // line of the previous consumed token
bool isEnd;
CTokenType lastType;
CState *cstate;
} CLexState;
CLexState *cosmoL_newLexState(CState *state, const char *source);