-
Notifications
You must be signed in to change notification settings - Fork 5
Description
yaml example:
'mapping:' + sLineBreak +
'- name: Person1' + sLineBreak +
' age: 20' + sLineBreak +
'name: John Doe' + sLineBreak +
'age: 30';
After parsing value yaml will be:
'mapping:' + sLineBreak +
' - name: John Doe' + sLineBreak +
' age: 30'
This occurs due to incorrect calculation of IndentLevel for sequence items in TYAMLLexer.NextToken:
result.TokenKind := TYAMLTokenKind.SequenceItem; // For sequence items, use the actual column position for proper nesting // Override the FSequenceItemIndent setting for this token result.IndentLevel := FReader.Column - 1; // Column is 1-based, indent is 0-based
should be:
result.TokenKind := TYAMLTokenKind.SequenceItem; // For sequence items, use the actual column position for proper nesting // Override the FSequenceItemIndent setting for this token result.IndentLevel := FReader.Column + 1; // Column is 1-based, indent is 0-based
Changing it to '+ 1' resolves the issue. All tests pass.