diff --git a/test/tquickstart.nim b/test/tquickstart.nim index 5c8180a..b408f70 100644 --- a/test/tquickstart.nim +++ b/test/tquickstart.nim @@ -103,7 +103,7 @@ proc testsFor(path: string, root: bool = true, titlePrefix: string = ""): NimNode {.compileTime.} = result = newStmtList() let - baseDir = staticExec("pwd") + baseDir = parentDir(staticExec("pwd")) nimPathRaw = staticExec("which nim") nimPath = if nimPathRaw[0] == '/': nimPathRaw else: baseDir / nimPathRaw title = titlePrefix & slurp(baseDir / path / "title").splitLines()[0] @@ -128,4 +128,4 @@ proc testsFor(path: string, root: bool = true, titlePrefix: string = ""): macro genTests(): untyped = testsFor("doc/snippets/quickstart") -genTests() \ No newline at end of file +genTests() diff --git a/yaml/parser.nim b/yaml/parser.nim index 200cf28..96c9f83 100644 --- a/yaml/parser.nim +++ b/yaml/parser.nim @@ -429,21 +429,14 @@ proc endLevel(c: ParserContext, e: var YamlStreamEvent): LevelEndResult = result = lerOne case c.level.kind - of fplSequence: - e = endSeqEvent() - of fplMapKey: - e = endMapEvent() + of fplSequence: e = endSeqEvent() + of fplMapKey: e = endMapEvent() of fplMapValue, fplSinglePairValue: e = emptyScalar(c) c.level.kind = fplMapKey result = lerAdditionalMapEnd - of fplUnknown: - if c.ancestry.len > 1: - e = emptyScalar(c) # don't yield scalar for empty doc - else: - result = lerNothing - of fplDocument: - e = endDocEvent() + of fplUnknown: e = emptyScalar(c) + of fplDocument: e = endDocEvent() of fplSinglePairKey: internalError("Unexpected level kind: " & $c.level.kind)