aaubry / YamlDotNet

YamlDotNet is a .NET library for YAML
MIT License
2.53k stars 471 forks source link

PRoblem with Literal Blocks?? #535

Open DynConcepts opened 3 years ago

DynConcepts commented 3 years ago

THe following snippet passes external validation/lint.... but fails...

`- task: manognaalla.ppmsigntool-task.PPMSignTool.PPMSignTool@4 displayName: 'Run PPMSignTool on CompressionUtils.dll' inputs: FilePath: 'bin\$(BuildPlatform)\$(BuildConfiguration)\CompressionUtils.dll' ConfigInput: InlineArg CompanyName: 'Hexagon, Hexagon PPM' ProductName: 'HxGN 3D GDS' LegalCopyRight: |

Arguments: force
SHA256: false

condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release')) `

Throws exception when it encounters the "A" in Arguments...

if (isLiteral && indentOfFirstLine > 1 && currentIndent < indentOfFirstLine - 1) { // W9L4 throw new SemanticErrorException(end, cursor.Mark(), "While scanning a literal block scalar, found extra spaces in first line."); }

DynConcepts commented 3 years ago

Himalaya-CI.yaml.txt

EdwardCooke commented 2 years ago

Thanks for the yaml example, it's much appreciated. I have simplified it down to a very small yaml example that breaks.

using YamlDotNet.Serialization;

var deserializer = new DeserializerBuilder().Build();

var yaml = @"a:
- b: |

  c: d
";

var a = deserializer.Deserialize<object>(yaml);