REditorSupport / REditorSupport/vscode-R

syntax: escaped backticks not handled in identifier

Open
#1,184 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

For example, the following is a valid identifier:

`\``

But the escaped backtick is treated as the end of the identifier, and so the final backtick is its own separate thing.

Screen Shot 2022-08-25 at 8 34 03 PM

https://github.com/REditorSupport/vscode-R/blob/da579cc17a9485f7a11bf5e75bf6b9c347eca116/syntax/r.json#L169-L172

I think a regular expression like the following would suffice:

([`](?:(?:\\\\.)|(?:[^`\\\\]))*[`])

Alternatively, I think the existing strategy for matching strings could be re-used for quoted identifiers.

https://github.com/REditorSupport/vscode-R/blob/da579cc17a9485f7a11bf5e75bf6b9c347eca116/syntax/r.json#L315-L335

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in syntax/r.json at the identifier rule around lines 169-172, then compare it with the quoted-string matching strategy around lines 315-335. Verify the grammar keeps an escaped backtick inside a quoted identifier and does not treat it as the closing delimiter.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, r, vscode
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.