core build system and array, it compiles!

This commit is contained in:
Krzosa Karol
2023-04-02 11:16:13 +02:00
parent 2be13cee30
commit 9bb355ed93
12 changed files with 45 additions and 192 deletions

View File

@@ -196,7 +196,7 @@ token_make(Core_Ctx *lexer) {
CORE_Static Token *
lex_last_indent_token(Lex_Stream *s) {
if (s->indent_stack.len > 0) {
return *s->indent_stack.last();
return *s->indent_stack.back();
}
return &pctx->same_scope_token;
}
@@ -326,7 +326,7 @@ lex__stream(Core_Ctx *lexer) {
semi.kind = OPEN_SCOPE;
semi.indent = last->indent + 2; // @todo: proper detection of indentation
lex_add_token(lexer, &semi);
s->indent_stack.add(lexer->tokens.last());
s->indent_stack.add(lexer->tokens.back());
}
else {
semi.kind = SAME_SCOPE;
@@ -347,7 +347,7 @@ lex__stream(Core_Ctx *lexer) {
if (t.indent > last->indent) {
t.kind = OPEN_SCOPE;
lex_add_token(lexer, &t);
s->indent_stack.add(lexer->tokens.last());
s->indent_stack.add(lexer->tokens.back());
}
else if (t.indent < last->indent) {