l20n / spec

Specification and design documents for L20n
http://l20n.github.com/spec/
10 stars 6 forks source link

Allow whitespace in section headers #5

Closed spagy closed 7 years ago

spagy commented 8 years ago

From grammar.ebnf

section ::= '[[' keyword ']]';

Between the square brackets and keyword there is no whitespace. However in tinker [[ section-header ]] accepted. This isn't technically a problem because keyword is defined as follows.

keyword ::= [^=|#{}\[\]()]+;

So it is allowed to contain whitespace. However in the example [[ section header ]] the indented header value is "section header" rather than " section header ".

stasm commented 7 years ago

You're that the grammar doesn't reflect the current parser's logic fully. I have an idea how to fix this.

spagy commented 7 years ago

You're that the grammar doesn't reflect the current parser's logic fully.

Sorry you've lost me

I have an idea how to fix this.

Shall I leave this to you then? I'm happy to do this otherwise.

stasm commented 7 years ago

I discussed with @zbraniecki who explained to me what the current logic in l20n.js's parses is. I'll submit a PR on Monday to update the grammar to be consistent with the behavior of the parser.