-
Notifications
You must be signed in to change notification settings - Fork 63
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
Should L24T/01/in.yaml and JEF9/02/in.yaml end with \n? #118
Comments
I recall looking into something like this where the presence of a final newline might affect the meaning. I am of the firm opinion that the presence or absence of a final line break should not ever change the meaning of a yaml stream. That said, I'm not 100% sure the 1.2.2 spec enforces that. All the implementations we regularly test agree on the meaning as seen here: This should probably be addressed as 1.2.2 errata (if it shown to be misrepresented in the productions) and fixed in 1.2.3. Looking at the spec link you provided:
would match here and CLIP is explained as
In my opinion, this explanation is assuming that all lines end with a line break. I'd go forward with handling all lines as if they end with a break. Looking forward to your implementation, Ingy |
Thanks a lot!
This makes sense to me. Could you clarify a bit where you plan to fix this? At first I thought I could just interpret end-of-line as Alternatively I suppose you could let Or yet another way could be to accept As my implementation uses parser combinators it follows the spec very closely, so knowing which way you're going would help to keep the two in sync. But there is no urgency on my side so I'm also perfectly happy to wait for an erratum / change for 1.2.3. |
I'm looking at an issue of my parser with L24T/01, added in #105. My parser gives back a string without trailing newline.
If I look at L24T/01/in.yaml in the data-2022-01-17 tag, the file does not have a trailing newline:
If my understanding of the spec is correct,
b-chomped-last
would then use the alternativeb-as-line-feed
rather than<end-of-input>
, so there should be no trailing newline parsed. Is this correct? Should the file be generated with a trailing newline, or should out.yaml be adapted? Or is my understanding of the spec incorrect?I have the same issue with JEF9/02, added in #90.
Pinging @ingydotnet & @perlpunk because you were involved in the PR that added this test.
The text was updated successfully, but these errors were encountered: