github / github/codeql

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

オープン
#21,801 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
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 にある 2 つの sort の例で Ruby parser の失敗を再現し、`\u0026` と識別子の間のスペースに注目します。この構文を処理する parser のエントリポイントを追跡し、ファイルの残りの部分のパースを妨げることなく、どちらの形式も受け入れられることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
ruby
領域
compilers
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。