new head desc

This commit is contained in:
Yaossg 2024-12-06 21:13:19 +08:00
parent 95871ff6bf
commit bf7061a7df
2 changed files with 17 additions and 7 deletions

15
boot.c
View file

@ -1,3 +1,14 @@
/*
* RVBTCC By Yaossg
* A lightweight bootstrapping compiler in less than 2000 lines.
*
* It aims to demonstrate how to write a bootstrapping compiler in no time.
* Syntax is similar to C, output is RISC-V assembly.
* Only dependent on some glibc functions for I/O.
* Purely for educational purposes. Do not use in production.
*
*/
// libc dependency
extern void* stdin;
@ -1140,9 +1151,7 @@ int parse_function_call(int id) {
int parse_primary_expr() {
next_token();
if (token_type == TOKEN_EOF) {
exit(1);
} else if (token_type == TOKEN_NUMBER) {
if (token_type == TOKEN_NUMBER) {
return load_imm(token_data);
} else if (token_type == TOKEN_ID) {
next_token();