From f78c2c5961bdd6bc67ec83cef9a9722c0f9c45cb Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Tue, 10 Jan 2017 12:00:15 +0100 Subject: [PATCH] Correctly handle `{1}`. Fixes #34 --- yaml/parser.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yaml/parser.nim b/yaml/parser.nim index cfeab9c..b5ca71e 100644 --- a/yaml/parser.nim +++ b/yaml/parser.nim @@ -975,7 +975,9 @@ parserState flowAfterObject: raise c.generateError("Unexpected token (expected ']')") of fplUnknown, fplSinglePairKey, fplDocument: internalError("Unexpected level kind: " & $c.level.kind) - result = c.leaveFlowLevel(e) + # we need the extra state for possibly emitting an additional empty value. + state = leaveFlowMap + return false of ltComma: case c.level.kind of fplSequence: discard