Point invalid I/O format-argument diagnostics at the offending token
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #970 de @LunaStev — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
Línea de trabajo
Empieza en front/parser/src/parser/io.rs:39 e inspecciona las ramas análogas del primer argumento de print y input. Añade pruebas específicas de spans de CLI/parser para los argumentos numéricos, booleanos y de identificador indicados, comprobando tanto los diagnósticos JSON como los legibles para humanos. El trabajo estará terminado cuando cada diagnóstico señale el argumento no válido y sigan cubiertos los formatos literales válidos y los diagnósticos existentes sobre aridad y precisión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
When the first argument of print, println or input is not a string literal, the parser consumes that argument and then constructs its error from the next token. JSON diagnostics point at ) or , and report that punctuation as the offending token instead of the actual invalid format argument.
Starting point: front/parser/src/parser/io.rs:39 and the analogous first-argument branches for print and input. This is a span/found-token correction, not a request to accept dynamic format strings. #425 replaced unsupported type-printing failures with structured errors; this report concerns the incorrect location of the invalid argument in those structured diagnostics.
Reproduction
Audited canonical master d59bdab376bdc04edacdc8029b256cb8d55b5adf on Linux amd64 with a checkout-built Wave 0.0.1-alpha-dev, Rust 1.89.0 and LLVM 21.1.8.
Run target/debug/wavec check repro.wave --error-format=json on each one-line source:
fun main() { print(1); }
fun main() { println(1); }
fun main() { var x: i32; input(1, x); }
Observed zero-based error.span.start values are 20, 22 and 32; the invalid 1 begins at 19, 21 and 31 respectively. error.found says Rparen for the first two and Comma for the third. All three correctly fail with exit 1; only diagnostic token selection is wrong.
Scope
Retain and use the first-argument token when rejecting a nonliteral format. Preserve the existing I/O grammar, structured diagnostic schema and output-file protection. Difficulty: easy, with focused CLI/parser span tests.
Completion criteria
- JSON and human diagnostics identify the invalid first argument, not following punctuation.
- Cover print/println/input with numeric, boolean and identifier arguments.
- Retain valid literal format handling and existing arity/precision diagnostics.
- Lenguaje dominante
- Rust
- Estrellas
- 56
- Forks
- 21
- Merge medio
- 5 h 2 min
- PR fusionados (30 d)
- 56
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wavefnd/Wave
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Distinguish Rust character literals from lifetimes in the spacing helperPosiblemente ocupada @hiyouwhatsapp la tomó hace 4 días. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Preserve truncation errors when bounded C-string copy uses the same bufferPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue needs testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Add checked floating-point byte readers and writersPosiblemente ocupada @LunaStev la tomó hace 1 día. Abiertoenhancement good first issue needs testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
Todos los issues de wavefnd/Wave
Issues similares
-
checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001Abiertobug known-issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
project-minigraf/minigraf#734 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
bitcoindevkit/electrum_streaming_client#57 ·
Los mantenedores suelen responder en 2 días