Potential typos and suggestions in the rule spec
Joshua Choi <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
I'm writing a Clojure parser based on the current YAML 1.2's rule
spec, and during my work I've run up against some apparent typos.
While it's being finalized, I'd like to bring up these parts of the
spec.
---
Rules 155 and 166, ns-s-implicit-yaml-key and c-s-implicit-json-key,
both end with the s-separate-in-line rule, meaning that they must end
with separation spaces. This means that the following example in the
spec is invalid:
{JSON: like}:adjacent
I think that "s-separate-in-line" should be changed to
"s-separate-in-line rule?".
---
Rule 112, s-s-double-escaped, currently says:
[112] s-s-double-escaped(n) ::= s-white* "\" b-non-content
l-empty(n,double)*
s-line-prefix(n,c)
The "double" in "l-empty(n,double)*" is probably incorrect. According
to another section in the spec, l-empty no longer takes a style
parameter like it does in YAML 1.1; l-empty now instead takes a
context parameter. I'm guessing that the "double" show
be either "flow-in" or "flow-out" instead.
---
In the same Rule 112: "s-line-prefix(n,c)" shouldn't have that "c"
inside the parentheses, because the rule doesn't take any context
argument. It should probably be either flow-in or flow-out, just like
the previous typo.
---
Rule 192, l-block-map-explicit-value, should start with s-indent(n).
Otherwise, this is invalid:
? Explicit key
: Explicit value
and this is valid:
? Explicit key
: Explicit value
---
Rule 208, l-implicit-document, contains a rule called
"ns-l+block-node", which was renamed to "s-l+block-node" after YAML
1.1. This actually shows a bigger problem:
Currently, s-l+block-node must begin with separation spaces. This is
good for within block scalars, where they must be separated from
whatever came before them:
- I am separated from the "-" marker.
...but it renders the following implicit document invalid:
"I am an implicit document without any preceding separation spaces."
...unless there happen to be separation spaces before the node.
I have no idea how to fix this, other than separating ns-l+block-node
from s-l+block-node so that ns-l+block-node does not require preceding
spaces, and put that in l-implicit-document instead.
---
I'd like to thank you all for such wonderful work. I think, though,
that before you release the final version of the YAML 1.2 spec, you
should review these typos, which seem to contradict the intent of the
spec.
Sincerely,
Joshua Choi
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p