comparison dmd/Json.d @ 96:acd69f84627e

further work
author Trass3r
date Tue, 31 Aug 2010 02:12:15 +0200
parents 43073c7c7769
children e28b18c23469
comparison
equal deleted inserted replaced
95:ae5b11064a9a 96:acd69f84627e
23 23
24 void json_generate(Array modules) 24 void json_generate(Array modules)
25 { 25 {
26 OutBuffer buf; 26 OutBuffer buf;
27 27
28 buf.writestring("[\n");
28 for (int i = 0; i < modules.dim; i++) 29 for (int i = 0; i < modules.dim; i++)
29 { 30 {
30 Module m = cast(Module)modules.data[i]; 31 Module m = cast(Module)modules.data[i];
31 if (global.params.verbose) 32 if (global.params.verbose)
32 writef("json gen %s\n", m.toChars()); 33 writef("json gen %s\n", m.toChars());
33 m.toJsonBuffer(buf); 34 m.toJsonBuffer(buf);
35 buf.writestring(",\n");
34 } 36 }
37 JsonRemoveComma(buf);
38 buf.writestring("]\n");
35 39
36 // Write buf to file 40 // Write buf to file
37 string arg = global.params.xfilename; 41 string arg = global.params.xfilename;
38 if (arg is null || arg[0] == 0) 42 if (arg is null || arg[0] == 0)
39 { // Generate lib file name from first obj name 43 { // Generate lib file name from first obj name