YamlDotNet icon indicating copy to clipboard operation
YamlDotNet copied to clipboard

SemanticErrorException on valid YAML

Open patrikbeno opened this issue 1 year ago • 0 comments
trafficstars

Error parsing { foo: &foo bar }

var scanner = new Scanner(new StringReader("{ foo: &foo bar }"));
var parser = new Parser(scanner);
while (parser.MoveNext()) {}
YamlDotNet.Core.SemanticErrorException : While parsing a flow mapping, did not find expected ',' or '}'.
   at YamlDotNet.Core.Parser.ParseNode(Boolean isBlock, Boolean isIndentlessSequence)
   at YamlDotNet.Core.Parser.ParseFlowMappingValue(Boolean isEmpty)
   at YamlDotNet.Core.Parser.StateMachine()
   at YamlDotNet.Core.Parser.MoveNext()

However, this would be OK: { foo: &foo bar, }. Also this: { foo: bar }

Version 16.0.0

patrikbeno avatar Aug 04 '24 11:08 patrikbeno