stuff (nearly crashing)

This commit is contained in:
2026-02-23 18:04:56 +11:00
parent efa605206a
commit 44aace638a
5 changed files with 42 additions and 11 deletions

View File

@@ -33,6 +33,8 @@ struct _SolsTokenTypeMap SolsTokenTypeMap[] = {
{"<", STT_OP_LESSER},
{">=", STT_OP_EQGREATER},
{"<=", STT_OP_EQLESSER},
{"\n", STT_LINE_END},
{";", STT_LINE_END},
// Shh, this is our little secret
// Your reward for actually reading the source code
// Enable this by adding -DSUPER_SILLY_MODE to your
@@ -472,6 +474,8 @@ ResultType(Nothing, charptr) lex(SolsLexer* lexer) {
case ')':
case ',':
case ':':
case ';':
case '\n':
{
if (strcmp(buf.str, "") != 0) {
ResultType(SolsToken, charptr) result = identifyToken(buf.str);
@@ -714,7 +718,7 @@ ResultType(Nothing, charptr) lex(SolsLexer* lexer) {
}
// This whitespace splits the program and does not get appended as it's own token.
case '\n':
case '\t':
case ' ': {
if (strcmp(buf.str, "") != 0) {
ResultType(SolsToken, charptr) result = identifyToken(buf.str);