github / github/codeql

Ruby parser errors on certain lambdas

Aperta
#9,313 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
acknowledged question Ruby
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

**Description of the issue**

I am seeing parser errors on Ruby lambdas. Here is a test case:

```
$ cat ruby-parser-errors.rb
def foo
puts "hi from foo"
end

foo() { boo( & lambda {}) }
foo() { boo( & ->{}) }
$
$ ruby -v
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux-gnu]
$
$ ruby ruby-parser-errors.rb
hi from foo
hi from foo
$
$ ruby -c ruby-parser-errors.rb
Syntax OK
$
$ codeql database create test-db --language=ruby --overwrite
...
[2022-05-24 20:40:17] [build-stdout] ERROR ruby-parser-errors.rb:5: parse error
[2022-05-24 20:40:17] [build-stdout] ERROR ruby-parser-errors.rb:6: parse error: expecting 'identifier'
[2022-05-24 20:40:17] [build-stdout] ERROR ruby-parser-errors.rb:6: missing value for field: binary::left
Finalizing database at .../test-db.
Successfully created database at .../test-db.
```

Please let me know if you need further information - Thank you

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.