Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#942 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu tại front/parser/src/parser/io.rs:39 và kiểm tra các nhánh tương tự cho đối số đầu tiên của print và input. Thêm các bài kiểm thử span CLI/parser tập trung cho những đối số số, boolean và định danh được liệt kê, kiểm tra cả chẩn đoán JSON lẫn chẩn đoán dễ đọc. Công việc hoàn tất khi mỗi chẩn đoán trỏ đến đối số không hợp lệ, đồng thời các định dạng literal hợp lệ và chẩn đoán hiện có về số lượng đối số và độ chính xác vẫn được kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Rust
Star
56
Fork
21
Merge trung bình
4 giờ 41 phút
Pull request đã merge (30 ngày)
58

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wavefnd/Wave

Tất cả issue của wavefnd/Wave

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.