Open am11 opened 3 years ago
Hi @am11
Thanks for your interest in the YAML spec. I'm glad you're here! I'm also glad you found https://spec.yaml.io/playground/parser
Three important works to help you on this journey are:
make test
to see.Theoretically we can generate correct parsers in all languages, as we make future changes to the grammar.
Note that the suite is not 100% complete, so the ref parser may not be 100% correct. We need lots of help on all fronts.
To your "Question: what are the disallowed characters in flow sequences?" you need to start at https://github.com/yaml/yaml-grammar/blob/master/yaml-spec-1.2.yaml#L2106 and continue down the rabbit hole.
I suggest writing a small program using the grammar yaml to do that, as the hole is somewhat deep.
Feel free to chat with us in our new chat forum https://matrix.to/#/#chat:yaml.io
@am11 I started this program to expand the grammar https://github.com/yaml/yaml-reference-parser/blob/show-grammar/build/show-grammar
$ ./show-grammar all < yaml-spec-1.2-patched.yaml
$ ./show-grammar refs < yaml-spec-1.2-patched.yaml
makes output like https://gist.github.com/ingydotnet/c0209c0a3dc7eb8919536f9ccd469fa6
Next I'll make the program support:
$ ./show-grammar c-flow-sequence < yaml-spec-1.2-patched.yaml
To expand all the rules under c-flow-sequence
to help answer your question.
[I wanted to open a discussion item, but there seem to be some problem #111]
I am still learning to parse the grammar syntax, but going by YAML 1.2
§7.4.1
, I think it does not prohibit consecutive commas or separated by whitespace.Following are considered ok by reference parser:
even after the 'tag handle'
aside: interestingly, comma after tag handle is disallowed in block sequences, see spec test U99R, but allowed in flow sequences and flow mapping. e.g.
but following are not:
this is unique to comma; the flow sequence separator.
So my question; is it implied somehow or did I miss writing on the wall? 🙂