@@ -47,7 +47,9 @@ fn generate_c_header(program: &BQNProgram) -> Result<String> {
4747
4848 // Lifecycle functions.
4949 out. push_str ( "/**\n " ) ;
50- out. push_str ( " * Initialise the CBQN runtime. Must be called before any other bqniser function.\n " ) ;
50+ out. push_str (
51+ " * Initialise the CBQN runtime. Must be called before any other bqniser function.\n " ,
52+ ) ;
5153 out. push_str ( " * Returns 0 on success, non-zero on failure.\n " ) ;
5254 out. push_str ( " */\n " ) ;
5355 out. push_str ( "int bqniser_init(void);\n \n " ) ;
@@ -66,7 +68,10 @@ fn generate_c_header(program: &BQNProgram) -> Result<String> {
6668 . map ( |( i, t) | format ! ( "{} arg{}" , t, i) )
6769 . collect :: < Vec < _ > > ( )
6870 . join ( ", " ) ;
69- out. push_str ( & format ! ( "{} {}({});\n \n " , ffi. return_type, ffi. c_name, params) ) ;
71+ out. push_str ( & format ! (
72+ "{} {}({});\n \n " ,
73+ ffi. return_type, ffi. c_name, params
74+ ) ) ;
7075 }
7176
7277 out. push_str ( "#ifdef __cplusplus\n " ) ;
@@ -145,10 +150,7 @@ fn generate_zig_impl(program: &BQNProgram) -> Result<String> {
145150 ) ) ;
146151
147152 // Function body: evaluate BQN expression via CBQN API.
148- out. push_str ( & format ! (
149- " // Evaluate: {}\n " ,
150- ffi. bqn_expr
151- ) ) ;
153+ out. push_str ( & format ! ( " // Evaluate: {}\n " , ffi. bqn_expr) ) ;
152154 out. push_str ( " _ = .{" ) ;
153155 // Reference all parameters to avoid unused-variable errors.
154156 for ( i, _) in ffi. param_types . iter ( ) . enumerate ( ) {
@@ -161,10 +163,7 @@ fn generate_zig_impl(program: &BQNProgram) -> Result<String> {
161163
162164 // Emit a placeholder BQN eval call.
163165 let escaped_expr = ffi. bqn_expr . replace ( '"' , "\\ \" " ) ;
164- out. push_str ( & format ! (
165- " const expr = \" {}\" ;\n " ,
166- escaped_expr
167- ) ) ;
166+ out. push_str ( & format ! ( " const expr = \" {}\" ;\n " , escaped_expr) ) ;
168167 out. push_str ( " const bqn_result = c.bqn_eval(expr.ptr, expr.len);\n " ) ;
169168 out. push_str ( " _ = bqn_result;\n " ) ;
170169
0 commit comments