18
18
19
19
static int Compact_mode = 0 ; /* set to 0 on default */
20
20
static int Max_line_size = 128 ;
21
+ const char C_end_statement [] = ";\n" ;
21
22
22
23
/* -----------------------------------------------------------------------------
23
24
* NewWrapper()
@@ -32,6 +33,7 @@ Wrapper *NewWrapper(void) {
32
33
w -> locals = NewStringEmpty ();
33
34
w -> code = NewStringEmpty ();
34
35
w -> def = NewStringEmpty ();
36
+ w -> end_statement = C_end_statement ;
35
37
return w ;
36
38
}
37
39
@@ -391,6 +393,7 @@ void Wrapper_print(Wrapper *w, File *f) {
391
393
392
394
str = NewStringEmpty ();
393
395
Printf (str , "%s\n" , w -> def );
396
+ if (Len (w -> locals ) > 0 )
394
397
Printf (str , "%s\n" , w -> locals );
395
398
Printf (str , "%s\n" , w -> code );
396
399
if (Compact_mode == 1 )
@@ -414,7 +417,7 @@ int Wrapper_add_local(Wrapper *w, const_String_or_char_ptr name, const_String_or
414
417
return -1 ;
415
418
}
416
419
Setattr (w -> localh , name , decl );
417
- Printf (w -> locals , "%s;\n " , decl );
420
+ Printf (w -> locals , "%s%s " , decl , w -> end_statement );
418
421
return 0 ;
419
422
}
420
423
@@ -482,7 +485,7 @@ char *Wrapper_new_local(Wrapper *w, const_String_or_char_ptr name, const_String_
482
485
}
483
486
Replace (ndecl , name , nname , DOH_REPLACE_ID );
484
487
Setattr (w -> localh , nname , ndecl );
485
- Printf (w -> locals , "%s;\n " , ndecl );
488
+ Printf (w -> locals , "%s%s " , ndecl , w -> end_statement );
486
489
ret = Char (nname );
487
490
Delete (nname );
488
491
Delete (ndecl );
0 commit comments