Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Point invalid I/O format-argument diagnostics at the offending token

Cerrado Apto para principiantes
#942 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
compilers

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

bug good first issue

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wavefnd/Wave

Todos los issues de wavefnd/Wave

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.