Ruby: &[SPACE][identifier] syntax breaks Ruby parsing
未关闭
question
- 主要语言
- CodeQL
- 星标
- 10.1k
- 派生
- 2.1k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 141
描述
CodeQL's Ruby breaks parsing breaks for the following code:
```ruby
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:
```ruby
sorted_array = array.sort(&custom_sorts[params[:sortby]])
```
贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- ruby
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100