Point invalid I/O format-argument diagnostics at the offending token
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
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ả
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wavefnd/Wave
-
enhancement good first issue needs testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Distinguish Rust character literals from lifetimes in the spacing helperCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
metasequoiaime/msime#9113 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:desktop priority:p2 type:chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: supply-chain
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Refresh stale docsĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 67/100
OpenCarControls/firmware#35 ·