Different behaviour between psych and libyaml on indentation
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 597
- Forks
- 223
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 3
Description
Hi,
When I try to parse the following YAML snippet:
- indentation 2 spaces
- indentation 2 spaces
- indentation 0 space
It fails with libyaml with error code = 4 (i.e. YAML_PARSER_ERROR) and description = did not find expected <document start>.
With psych, it does not complain at all.
Any idea why?
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the YAML snippet with both libyaml and Psych, then trace the parser entry points responsible for document-start and indentation handling. Compare the resulting errors and behavior; done means the discrepancy is explained and a concrete correction or documentation outcome is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, yaml
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100