-
Notifications
You must be signed in to change notification settings - Fork 60
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
Do the productions in the YAML 1.2 spec allow spaces in plain scalars? #319
Comments
See:
This is included in
|
👍 Thank you! Especially, for those paths; that really helps. In future, I'll take more time to interpret the productions and their relationships. I confess that, while I've had some exposure to BNF in other contexts, I'm not yet at ease with the parameterized productions in the YAML spec, and I'm finding them a little difficult to follow. My problem; I'll get there. I acknowledge and appreciate the more detailed descriptions of these productions in the YAML 1.2 spec compared to the YAML 1.1 spec. (YAML blog: "The parameterized BNF used by the spec is now fully documented".) My embarrassment is outweighed by being happy and grateful to have learned something. Thanks again. 🙂 |
Cringe, sorry: I closed this issue as "Complete" without thinking too hard about it. Maybe "Not planned" would have been better. |
Feedback is appreciated. I basically just kind of made up the parameterization formalism, loosely inspired by the ECMAScript spec (which only has to deal with finitely many cases). I think it's fundamentally sound, but there's surely room for improvement. I mean, I straight-up forgot to define the difference operator (#293). I'm just happy that it's sufficiently well-defined that people can nitpick it. A minor point, but the grammar more closely resembles a Parsing Expression Grammar than it does BNF. The chief difference is that in a PEG, alternation (and other operators) is ordered, so if |
In brief
As far as I can tell, the answer is "No".
Either:
(a) I'm missing something
or
(b) There's a problem with the productions
I'm inclined to think it's (a). I think it's much more likely that I'm not correctly interpreting the productions.
Still, if it's (a): what am I missing? Could someone please quote the specific snippet of a production in the YAML 1.2 spec that allows spaces in a plain scalar? I can't find it.
In detail
The YAML 1.1 and 1.2 specs both contain numerous examples of spaces in plain scalars.
For example, the space between
Mark
andMcGwire
:I can see how the productions for plain scalars in the YAML 1.1 spec allow spaces: those productions are based on
nb-char
, which includes the space character.However, all the productions for plain scalars in the YAML 1.2 spec (not just the first character) are based on
ns-char
, which excludes the space character.Here, in this issue, I'm specifically asking about what the productions in the YAML 1.2 spec allow, not what implementations allow.
The text was updated successfully, but these errors were encountered: