diff options
Diffstat (limited to 'src/report_unknown.d')
| -rw-r--r-- | src/report_unknown.d | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/report_unknown.d b/src/report_unknown.d deleted file mode 100644 index 1d5238e..0000000 --- a/src/report_unknown.d +++ /dev/null @@ -1,41 +0,0 @@ -module report_unknown; - -import std.algorithm : sort; -import std.array : array; -import std.stdio : writeln, writefln; -import ssp_types; - -/+ ↓ say what was read and not understood. - This is what makes the reader usable as a check on the format - specification: a reader that ignores what it does not know is - conforming, but one that cannot say what it ignored cannot tell you - whether the specification it was written from was complete. Silence - and understanding look the same from outside. -+/ -void reportUnknown(ref SspDocument doc) { - if (!doc.unknown.any) { - writeln("\nread and understood: every property, block and line was known"); - return; - } - writeln("\nread and NOT understood:"); - if (doc.unknown.property.length > 0) { - writeln(" properties ignored (", doc.unknown.property.length, " distinct):"); - foreach (name; doc.unknown.property.keys.sort) { - writefln(" .%-26s %8d", name, doc.unknown.property[name]); - } - } - if (doc.unknown.block.length > 0) { - writeln(" blocks ignored (", doc.unknown.block.length, " distinct):"); - foreach (name; doc.unknown.block.keys.sort) { - writefln(" @%-26s %8d", name, doc.unknown.block[name]); - } - } - if (doc.unknown.line.length > 0) { - writeln(" lines of no known shape, by first character:"); - foreach (c; doc.unknown.line.keys.sort) { - writefln(" %-27s %8d", "\"" ~ c ~ "\"", doc.unknown.line[c]); - } - } - writeln(" (ignoring these is conforming within a major version;", - " the count is so that it is not silent)"); -} |
