lexer go brrr
This commit is contained in:
parent
b03364e3d9
commit
3bdd778b56
9
lexer.c
9
lexer.c
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue