Skip to content
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

Minimal fix to #200, banning string-like idents #241

Closed
wants to merge 2 commits into from

Conversation

tabatkins
Copy link
Contributor

Rather than banning # in idents altogether, as #204 does, this takes the same approach as our number-like handling, and just bans idents from looking like a raw string in their first two characters: just as an ident can't start with digit or sign digit, it now can't start with r# or r" either. (That last isn't an ident, but it prevents a naive parser not using first-wins collision resolution from reading it as an ident r followed by junk.)

It also refactors the bare-ident production a bit to make the structure clearer, as it was already getting a bit messy just trying to ban number-likes.

Rather than banning `#` in idents altogether, as #204 does, this takes the same approach as our number-like handling, and just bans idents from looking like a raw string *in their first two characters*: just as an ident can't start with `digit` or `sign digit`, it now can't start with `r#` or `r"` either.  (That last isn't an ident, but it prevents a naive parser not using first-wins collision resolution from reading it as an ident `r` followed by junk.)

It also refactors the bare-ident production a bit to make the structure clearer, as it was already getting a bit messy just trying to ban number-likes.
@tabatkins tabatkins added the breaking This can only be done for the next major version of KDL label Oct 17, 2021
SPEC.md Outdated Show resolved Hide resolved
@zkat zkat mentioned this pull request Aug 28, 2022
tabatkins added a commit that referenced this pull request Oct 6, 2023
@zkat
Copy link
Member

zkat commented Dec 11, 2023

This is already in the v2 branch. Closing.

@zkat zkat closed this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This can only be done for the next major version of KDL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants