example fixes

This commit is contained in:
2025-07-29 18:53:38 +02:00
parent ddfa538a5c
commit 2c09d7bc21
9 changed files with 49 additions and 38 deletions

View File

@@ -103,7 +103,7 @@ section .text
);
// take that rustfmt
for name in "malloc,calloc,realloc,free,puts,printf,sprintf,snprintf,strtol,strlen,strcmp,strcat,strcpy,strdup,strncpy,syscall,fopen,fseek,ftell,fread,fwrite,fclose,rewind,system,opendir,readdir,closedir,exit,gettimeofday,connect,socket,send,write,read,close,bind,listen,accept,getchar,gethostbyname".split(",")
for name in "malloc,calloc,realloc,free,puts,putchar,printf,sprintf,snprintf,strtol,strlen,strcmp,strncmp,strcat,strcpy,strdup,strncpy,syscall,fopen,fseek,ftell,fread,fwrite,fclose,rewind,system,opendir,readdir,closedir,exit,gettimeofday,connect,socket,send,write,read,close,bind,listen,accept,getchar,gethostbyname".split(",")
{
emit!(&mut self.output, "extern {}", name);
emit!(&mut self.output, "c.{} equ {}", name, name);

View File

@@ -280,13 +280,8 @@ impl Tokenizer {
fn count_indentation(&mut self) -> usize {
let mut count = 0;
while self.peek() == ' ' || self.peek() == '\t' {
if self.peek() == ' ' {
count += 1;
}
if self.peek() == '\t' {
count += 4;
}
while self.peek() == ' ' {
count += 1;
self.advance();
}
count