Skip to content

Keep delimiter and argument-count details in print and input errors #976

Closed

Description

@LunaStev

Problem

The I/O parsers replace known delimiter/string/arity failures with expected valid print/println/input. Input arity failures are generated after the call terminator, so the diagnostic can blame the following statement or closing brace.

Reproduction

Audited canonical master 42b65e426ad45bf896623b5bce814312b694a0c7 on Linux amd64 with Rust 1.89 and LLVM 21.1.8. Reproductions use the checkout-built target/debug/wavec and matching checkout std. The local head d2f58962 has an identical file tree to that canonical merge. Commands below assume WAVEC names that binary.

fun main() { input("{} {}"); }
"$WAVEC" --error-format=json check main.wave

Observed: expected valid input in input at the closing } (column 30), without stating that two arguments are missing. fun main() { print 1; } reports only expected valid print rather than a missing (. Also executed print(123): #942's token span is preserved, but the expected string-literal detail is still absent.

Scope

Use specific structured syntax and argument-count diagnostics for print, println and input. Preserve the first-argument span fix in #942, placeholder semantics, expression evaluation order and input policy. Do not broaden the formatting syntax.

Starting points: front/parser/src/parser/io.rs.

Completion criteria

  • Expected parentheses, string literals and terminators are named in expected/message fields.
  • All three builtins report expected/actual argument counts at the call or format literal.
  • Human/JSON and check/build agree; valid plain/formatted calls remain accepted.

Related: #346, #942. #361 owns general statement semicolon diagnostics.

Activity

  1. self-assigned this
    on Oct 21, 2026
  2. added
    bug
    on Oct 21, 2026
  3. added a commit that references this issue on Oct 22, 2026
    aef39a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions