Disallowing "r#" at the beginning of identifiers #200
Replies: 4 comments 7 replies
-
This definitely requires some attention. As much as it pains me, I'm in favor of disallowing From an impl perspective, allowing such identifiers requires unbounded lookahead as far as I can figure, which is certainly prohibitive. Because kdl4j is hand written I can certainly tweak things to allow it, but others implementations may not be able. |
Beta Was this translation helpful? Give feedback.
-
I don't think it's a tiny nitpick. I think it's pretty significant, and warrants having a discussion with implementers about putting out a new spec. |
Beta Was this translation helpful? Give feedback.
-
Can someone volunteer to put up a PR that disallows |
Beta Was this translation helpful? Give feedback.
-
I believe this is also the case with numbers. Consider the token |
Beta Was this translation helpful? Give feedback.
-
As far as I can tell from the spec,
r#####
is a perfectly valid identifier. At the moment, given a sequence of characters representing a single kdl value or identifer, all types of values can be identified solely based upon their first two characters except for raw strings because of this particular case. For consistency, I'd also be in favor of disallowing#
altogether from identifiers.This is a tiny nitpick, but it makes sense to me from an implementer perspective!
Beta Was this translation helpful? Give feedback.
All reactions