Skip to content

Commit

Permalink
got it building again, DOS EOL screwed me once again
Browse files Browse the repository at this point in the history
  • Loading branch information
burner committed Jun 11, 2021
1 parent 15941a4 commit 6ab94d3
Show file tree
Hide file tree
Showing 5 changed files with 784 additions and 779 deletions.
11 changes: 8 additions & 3 deletions fakerjsgenerator/source/generator.d
Original file line number Diff line number Diff line change
Expand Up @@ -813,23 +813,28 @@ class Faker_%1$s : Faker%2$s {
}

string buildString(string name, string postfix, string[] lines) {
import std.utf : byUTF;
import std.utf : byUTF, replacementDchar;
string fname = name ~ "_" ~ postfix;
fname = fname.camelCase();

//writefln("%s %s", fname, this.locale);
string[] nlines;
foreach(idx, ref line; lines) {
try {
string s = line.byUTF!dchar().to!string();
string s = line.byUTF!dchar()
.filter!(it => it != replacementDchar)
.to!string();
writefln("'%s'", s);
nlines ~= s;
} catch(Throwable t) {
writefln("%s %s", idx, line);
}
}

this.buildStringImpl(fname,
nlines.map!(a => "\"" ~ a ~ "\"").joiner(",\n\t\t").to!string()
nlines.map!(a => "\"" ~ a ~ "\"")
.joiner(",\n\t\t")
.to!string()
);

return fname;
Expand Down
Loading

0 comments on commit 6ab94d3

Please sign in to comment.