summaryrefslogtreecommitdiffhomepage
path: root/dlang/src/ocda/load_ssp.d
diff options
context:
space:
mode:
Diffstat (limited to 'dlang/src/ocda/load_ssp.d')
-rw-r--r--dlang/src/ocda/load_ssp.d26
1 files changed, 13 insertions, 13 deletions
diff --git a/dlang/src/ocda/load_ssp.d b/dlang/src/ocda/load_ssp.d
index ccaa0f4..83e3572 100644
--- a/dlang/src/ocda/load_ssp.d
+++ b/dlang/src/ocda/load_ssp.d
@@ -27,7 +27,7 @@ OcdaDocument parseSsp(string content) {
string current_block = ""; // meta, make, doc_has, or section name
foreach (line; content.splitter("\n")) {
- /+ ↓ comment. The first line of a .ssp declares the format version, and
+ /+ ↓ comment. The first line of a .ssp declares the format version, and
it is the one comment that carries meaning: a reader checks the
major part and refuses what it does not know rather than loading
an unfamiliar artefact half populated in silence.
@@ -43,7 +43,7 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ blank line - finalize current object +/
+ /+ ↓ blank line - finalize current object +/
if (line.length == 0 || line.strip.length == 0) {
if (in_object) {
commitObject(doc, current_section, current_obj);
@@ -54,7 +54,7 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ section/block open +/
+ /+ ↓ section/block open +/
if (line[0] == '@') {
auto brace_pos = line.indexOf('{');
if (brace_pos > 0) {
@@ -62,7 +62,7 @@ OcdaDocument parseSsp(string content) {
current_block = name;
if (!isPreambleBlock(name)) {
current_section = name;
- /+ ↓ a block that is neither preamble nor a section this reader
+ /+ ↓ a block that is neither preamble nor a section this reader
knows: counted, so that --report-unknown can say so +/
if (doc.sectionByName(name) is null) {
doc.unknown.block[name]++;
@@ -72,7 +72,7 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ section/block close +/
+ /+ ↓ section/block close +/
if (line[0] == '}') {
if (in_object) {
commitObject(doc, current_section, current_obj);
@@ -84,7 +84,7 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ inside meta/make/doc_has blocks: key-value pairs +/
+ /+ ↓ inside meta/make/doc_has blocks: key-value pairs +/
if (isPreambleBlock(current_block)) {
string stripped = line.stripLeft;
auto colon_pos = stripped.indexOf(':');
@@ -100,7 +100,7 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ object declaration: [N] type ... +/
+ /+ ↓ object declaration: [N] type ... +/
if (line[0] == '[') {
if (in_object) {
commitObject(doc, current_section, current_obj);
@@ -113,7 +113,7 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ property: .name: value +/
+ /+ ↓ property: .name: value +/
if (line[0] == '.') {
if (in_object) {
parseProperty(line, current_obj, doc.unknown);
@@ -121,7 +121,7 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ text content: | content +/
+ /+ ↓ text content: | content +/
if (line.length >= 1 && line[0] == '|') {
if (in_object) {
string text_content = (line.length > 2) ? line[2 .. $] : "";
@@ -135,13 +135,13 @@ OcdaDocument parseSsp(string content) {
continue;
}
- /+ ↓ no known shape. Counted by its first character so that a reader
+ /+ ↓ no known shape. Counted by its first character so that a reader
can be told the file held something this one did not expect
+/
doc.unknown.line[line[0 .. 1].idup]++;
}
- /+ ↓ finalize last object +/
+ /+ ↓ finalize last object +/
if (in_object) {
commitObject(doc, current_section, current_obj);
}
@@ -179,7 +179,7 @@ private void parseObjectDeclaration(string line, ref OcdaObject obj) {
}
}
-/+ ↓ the blocks that are document preamble rather than sections of objects +/
+/+ ↓ the blocks that are document preamble rather than sections of objects +/
private bool isPreambleBlock(string name) {
return name == "source" || name == "meta" || name == "make" || name == "doc_has";
}
@@ -236,7 +236,7 @@ private void parseProperty(string line, ref OcdaObject obj, ref OcdaUnknown unkn
case "heading_ancestors_text": obj.heading_ancestors_text = value; break;
case "sha256": obj.sha256 = value; break;
case "image": obj.images ~= parseImageRecord(value); break;
- /+ ↓ a property this reader has no use for, or has never heard of.
+ /+ ↓ a property this reader has no use for, or has never heard of.
Ignored, which is the conforming behaviour within a major
version, but counted rather than passed over in silence
+/