@@ -72,8 +72,7 @@ typedef struct
7272
7373static void next_token (lexer * lx )
7474{
75- while (* lx -> cur && isspace ((unsigned char )* lx -> cur ))
76- lx -> cur ++ ;
75+ while (* lx -> cur && isspace ((unsigned char )* lx -> cur )) lx -> cur ++ ;
7776 char c = * lx -> cur ;
7877 if (!c )
7978 {
@@ -99,8 +98,7 @@ static void next_token(lexer *lx)
9998 lx -> tok .kind = TOK_NUMBER ;
10099 lx -> tok .value = (int )val ;
101100 size_t len = (size_t )(end - lx -> cur );
102- if (len >= sizeof (lx -> tok .text ))
103- len = sizeof (lx -> tok .text ) - 1 ;
101+ if (len >= sizeof (lx -> tok .text )) len = sizeof (lx -> tok .text ) - 1 ;
104102 memcpy (lx -> tok .text , lx -> cur , len );
105103 lx -> tok .text [len ] = '\0' ;
106104 lx -> cur = end ;
@@ -109,11 +107,9 @@ static void next_token(lexer *lx)
109107 if (isalpha ((unsigned char )c ))
110108 {
111109 const char * start = lx -> cur ;
112- while (* lx -> cur && (isalnum ((unsigned char )* lx -> cur ) || * lx -> cur == '_' ))
113- lx -> cur ++ ;
110+ while (* lx -> cur && (isalnum ((unsigned char )* lx -> cur ) || * lx -> cur == '_' )) lx -> cur ++ ;
114111 size_t len = (size_t )(lx -> cur - start );
115- if (len >= sizeof (lx -> tok .text ))
116- len = sizeof (lx -> tok .text ) - 1 ;
112+ if (len >= sizeof (lx -> tok .text )) len = sizeof (lx -> tok .text ) - 1 ;
117113 memcpy (lx -> tok .text , start , len );
118114 lx -> tok .text [len ] = '\0' ;
119115 lx -> tok .kind = TOK_IDENT ;
@@ -261,8 +257,7 @@ static int find_function(function *fns, int count, const char *name)
261257{
262258 for (int i = 0 ; i < count ; i ++ )
263259 {
264- if (strcmp (fns [i ].name , name ) == 0 )
265- return i ;
260+ if (strcmp (fns [i ].name , name ) == 0 ) return i ;
266261 }
267262 return -1 ;
268263}
@@ -379,14 +374,12 @@ int main(void)
379374 resolve_calls (& arena , functions , function_count );
380375
381376 cj_ctx * cj = create_cj_ctx ();
382- for (int i = 0 ; i < function_count ; i ++ )
383- functions [i ].entry = cj_create_label (cj );
377+ for (int i = 0 ; i < function_count ; i ++ ) functions [i ].entry = cj_create_label (cj );
384378
385379 codegen cg = {.cj = cj , .functions = functions };
386380 emit_function (& cg , & functions [main_idx ]);
387381 for (int i = 0 ; i < function_count ; i ++ )
388- if (i != main_idx )
389- emit_function (& cg , & functions [i ]);
382+ if (i != main_idx ) emit_function (& cg , & functions [i ]);
390383
391384 cj_fn module = create_cj_fn (cj );
392385 if (!module )
0 commit comments