-
-
Notifications
You must be signed in to change notification settings - Fork 36
Name syntax should align with XML #519
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
Comments
Thanks for filing this. Historically, I was very interested in aligning with XML's In particular, I think there's more benefit in aligning
|
I don't think there's much value in allowing variable/function names like |
Is this being addressed in the new syntax changes (which align |
It's in a much better spot now, but I would say not actually resolved until the definition of |
The changes @gibson042 mentions have been landed in the ABNF and spec. I think this is ready to close? |
I agree; this seems done to me with the current ABNF: unquoted = name / number-literal
…
; number-literal matches JSON number
; https://www.rfc-editor.org/rfc/rfc8259#section-6
number-literal = ["-"] (0 / ([1-9] *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"] 1*DIGIT]
; identifier matches https://www.w3.org/TR/REC-xml-names/#NT-QName
; name matches https://www.w3.org/TR/REC-xml-names/#NT-NCName
identifier = [namespace ":"] name
namespace = name
name = name-start *name-char
name-start = ALPHA / …
name-char = name-start / DIGIT / "-" / "."
/ %xB7 / %x300-36F / %x203F-2040
… |
As noted elsewhere (e.g., #399 (comment) ), it's not good to almost align with an external specification.
name
is already close to XMLName
and even mentions it, and that gap should just be fully closed.Doing so would have the following consequences:
unquoted
would simplify to either1*name-char
(matching XMLNmtoken
) or1*unquoted-char
(if expanding to e.g. include+
for parity with-
).:
to something that does not overlap withunquoted
or other syntax (such as}
for closing the expression,|
for quoting,$
for variables, and any sigil indicating spannable open/close) and doesn't mislead developers—starting with!"#$%&'()*+,/;<=>?@[\]^`{|}~
for the first concern, I think that leaves something like*=@^~
in which@
is particularly attractive to me (e.g.,{$count @number}
) but a reasonable case could be made for any of the others.|
as in Jinja and literal quoting would use something else (e.g.,{~0.40~ |number style=percent}
)Related issues:
nmtoken
withunquoted
#364The text was updated successfully, but these errors were encountered: