lexer go brrr

This commit is contained in:
_N3m0 2023-12-31 18:04:56 +01:00
parent b03364e3d9
commit 3bdd778b56
1 changed files with 6 additions and 3 deletions

View File

@ -8,6 +8,7 @@ Cursor cursor = {
}; };
char* nextchar(void){ char* nextchar(void){
if (cursor.chunk >= page.len) return NULL;
if (page.chunks[cursor.chunk][cursor.offset+1] == '\0'){ if (page.chunks[cursor.chunk][cursor.offset+1] == '\0'){
cursor.chunk++; cursor.chunk++;
cursor.offset = 0; cursor.offset = 0;
@ -34,9 +35,11 @@ Token* nexttoken(void){
*/ */
puts(""); puts("");
for (int i=0; i<200; i++){ char* c = nextchar();
printf("%c", *nextchar()); do {
} printf("%c", *c);
c = nextchar();
} while (c != NULL);
puts(""); puts("");
return token; return token;