l20n / spec

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

Allow whitespace around section headers #9

Closed stasm closed 7 years ago

stasm commented 7 years ago

Fixes #5. @zbraniecki -- this implements the changes we talked about last week to characters allowed in keywords, including white-space. Note that currently the l20n.js parser doesn't allow non-Latin characters in keywords. Should we update the spec here for now?

stasm commented 7 years ago

@zbraniecki what are you thoughts on the current behavior of the l20n.js parser wrt. the chars allowed in keywords?

zbraniecki commented 7 years ago

umm, not sure what are you asking about. The l20n.js parser handles characters allowed in keywords?

stasm commented 7 years ago

The grammar specifies that all possible characters except a shorthand of special ones like /, # etc. are allowed as keywords. However, the following doesn't parse in the l20n.js's parsers (ast and runtime):

foo =
    [ą] Ą

I'm asking if you have cycles to fix this in the parser or would you rater have me change the grammar for now and limit keywords to ASCII chars. Allowing more chars in the future will be backwards-compatible.

zbraniecki commented 7 years ago

I think I'd prefer to limit the chars in the spec for now. I'm concerned about non-ascii character being more confusing than helpful at this point.

stasm commented 7 years ago

I removed the additional symbols for allowed characters and also restricted keywords to ASCII for now. I'd like to go back to being more lax in the future. I also considered using named character classes like [:alpha:] but they're locale-dependent.

stasm commented 7 years ago

@zbraniecki can you take another look?

stasm commented 7 years ago

@zbraniecki ping

zbraniecki commented 7 years ago

looks great! Sorry for holding you for so long.