|
|
|
@ -20,8 +20,8 @@ class TwoDA{
|
|
|
|
|
string data[];
|
|
|
|
|
|
|
|
|
|
auto results = matchAll(line, rgxField);
|
|
|
|
|
if(results.hit is null)
|
|
|
|
|
throw new ParseException(filepath~":"~index.to!string~" Incorrect 2da line (not parseable)");
|
|
|
|
|
if(results.empty)
|
|
|
|
|
throw new ParseException("Could not parse fields in line: "~filepath~":"~index.to!string);
|
|
|
|
|
|
|
|
|
|
foreach(res ; results){
|
|
|
|
|
string s;
|
|
|
|
@ -31,9 +31,11 @@ class TwoDA{
|
|
|
|
|
|
|
|
|
|
if(index==0){
|
|
|
|
|
header = data;
|
|
|
|
|
//writeln(header);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(data.length != header.length)
|
|
|
|
|
throw new ParseException("Incorrect number of fields: "~filepath~":"~index.to!string);
|
|
|
|
|
|
|
|
|
|
int nLine = data[0].to!int;
|
|
|
|
|
values[nLine] = data[1..$];
|
|
|
|
|
//writeln(values[nLine]);
|
|
|
|
|