Negative literals are borked
Abierto
Apto para principiantes
- Lenguaje dominante
- Rust
- Estrellas
- 21
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
`print -5;` says:
```
LHS missing for `-` at 0:6
Expected expression, found: `)` at 0:8
Parsing failed, see errors above.
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
The issue is in the parser's handling of unary minus. Look at the parser module, likely in src/parser.rs, for the expression parsing logic. The error messages indicate it expects a left-hand side for the '-' operator. Check how the parser distinguishes between binary subtraction and unary negation. Run the existing tests to see if there are any for negative literals, and add a test case for `print -5;` to verify the fix.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 70/100