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

Formatter drops a comment before the spread of a list pattern like `list{/* c */ ...r}`

Đang mở
#9,123 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
56/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ệ
ocaml
Lĩnh vực
compilers

Hướng nghiên cứu

Start by reading the formatter and pattern printing code for list patterns, then trace how comments attached to a spread are handled when list{...r} parses to r. Reproduce with the supplied bsc -format example and compare it with the expression case and the list{a, /* e */ ...r} case. Done means formatting preserves /* d */ in the pattern.

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

Mô tả

Formatting drops a comment written before the spread of a list pattern that has no other items.

let f = x =>
  switch x {
  | list{/* d */ ...r} => r
  }

bsc -format (master at 3562ce6b80) prints:

let f = x =>
  switch x {
  | r => r
  }

The comment /* d */ is gone. list{...r} parses to the pattern r itself, so the printer prints r, and the comment attached to the spread is never printed. The expression list{/* h */ ...xs} keeps its comment (/* h */ xs), and list{a, /* e */ ...r} keeps it too (with #9119).

Found while working on #9107; #9119 does not change this case.

🤖 Generated with Claude Code

Ngôn ngữ chính
OCaml
Star
7.5k
Fork
484
Merge trung bình
20 giờ 19 phút
Pull request đã merge (30 ngày)
242

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 rescript-lang/rescript

Tất cả issue của rescript-lang/rescript

Issue tương tự

Thêm issue về Compilers

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.