Ruby: &[SPACE][identifier] syntax breaks Ruby parsing
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by reproducing the Ruby parser failure with the two sort examples in the issue, focusing on the space between & and the identifier. Trace the parser entry point that handles this syntax and verify that both forms are accepted without preventing the rest of the file from being parsed.
Written by the indexing model from the issue text.
Description
CodeQL's Ruby breaks parsing breaks for the following code:
sorted_array = array.sort(& custom_sorts[params[:sortby]])
I understand that the following should be how this is written, but sometimes people put weird syntax in and it shouldn't break a whole file being parsed:
sorted_array = array.sort(&custom_sorts[params[:sortby]])
- Dominant language
- CodeQL
- Stars
- 10.1k
- Forks
- 2.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 143
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/codeql
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
false-positive javascript
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
C#: cs/simplifiable-boolean-expression false positive on Nullable<bool> compared with a literal Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
false-positive
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
oxc-project/oxc#26944 ·
-
todo:perf
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 Half a day Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tenstorrent/tt-metal#57393 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
objectionary/eo#8894 ·