github / github/codeql

Ruby: &[SPACE][identifier] syntax breaks Ruby parsing

未關閉
#21,801 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
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]])
```

貢獻指南

開啟貢獻指南

研究方向

先使用 issue 中的兩個 sort 範例重現 Ruby parser 的失敗,重點關注 `\u0026` 與識別碼之間的空格。追蹤處理此語法的 parser 進入點,並確認兩種形式都能被接受,同時不會阻止檔案其餘部分被解析。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
ruby
領域
compilers
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。