-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PRoblem with Literal Blocks?? #535
Labels
Comments
Closed
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); |
another simple example is // @nuget: YamlDotNet -Version 16.1.2
ToJson("|\n\n foo\n"); // prints "\nfoo\n"
ToJson("|\n \n bar\n"); // prints "\nbar\n"
ToJson("|\n \n baz\n"); // should print "\nbaz\n"
// but fails While scanning a literal block scalar, found extra spaces in first line.
ToJson("|\n \n nope\n");
// fails as expected with While scanning a literal block scalar, found extra spaces in first line.
void ToJson(string s) {
var deserializer = new YamlDotNet.Serialization.DeserializerBuilder().Build();
try {
var json = System.Text.Json.JsonSerializer.Serialize(deserializer.Deserialize<string>(s));
System.Console.WriteLine(s);
} catch (System.Exception e) {
System.Console.WriteLine(e);
}
} (formatted so that it can be trivially used in https://dotnetfiddle.net/# ) @EdwardCooke is this considered a bug? Would you accept a PR adding a test and fix for this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: |
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."); }
The text was updated successfully, but these errors were encountered: