github / github/codeql

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

Abierto
#21,801 1 comentario 0 reacciones 0 asignados Ver en GitHub
question
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

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]])
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
ruby
Área
compilers
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.