Formatter prints @res.doc on a function parameter as a doc comment that does not parse
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
- 68/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 tracing bsc -format from the formatter path that prints @res.doc on function parameters; compare it with how @ocaml.doc and @ns.doc are preserved, and inspect the parser around parameter doc comments. The issue permits either keeping the attribute form in formatter output or accepting the comment in the parser. Done means the shown input formats to output that parses successfully when formatted again.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The formatter prints a @res.doc attribute on a function parameter as a doc comment in front of the parameter, and the parser rejects that output.
let f = (@res.doc("The runner") run: string) => run
bsc -format prints:
let f = (
/**The runner*/
run: string,
) => run
Formatting that output again fails:
Syntax error!
2 │ /**The runner*/
3 │ run: string,
I'm not sure what to parse here when looking at "DocComment The runner".
So formatting turns a file that compiles into one that doesn't. @ocaml.doc/@ns.doc on a parameter have been formatted unchanged, because the printer prints only res.doc as a doc comment. If #8992 lands, @res.doc is the only doc attribute left, so writing it by hand on a parameter hits this. genType's tests/gentype_tests/typescript-react-example/src/Comments.res keeps @ocaml.doc on two parameters for this reason.
Either the printer keeps the attribute form for parameters, or the parser accepts a doc comment before a parameter.
Found while working on #8978.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- OCaml
- Star
- 7.5k
- Fork
- 483
- Merge trung bình
- 20 giờ 28 phút
- Pull request đã merge (30 ngày)
- 201
Chuẩn bị môi trường
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.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 rescript-lang/rescript
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rescript-lang/rescript#9006 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
rescript-lang/rescript#8997 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@notUndefined in an interface is not checked against the implementationCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rescript-lang/rescript#8964 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Have formatter insert newlines around multi-line expressionsCó thể đã có người làm @rolandpeelen đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
rescript-lang/rescript#8960 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
rescript-lang/rescript#8955 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rescript-lang/rescript
Issue tương tự
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLCó thể đã có người làm @ninglinLiu đã nhận hôm nay. Đang mởarea:frontend backend:slang bug direction:input
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Decompiler: convertCharRef() in xml.y overflows its int4 accumulator on long character referencesCó thể đã có người làm @kaayzouee đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
NationalSecurityAgency/ghidra#10009 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] tree-sitter-bash parses `$_` / `${_}` as variable_name instead of special_variable_nameĐang mở
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 85/100
MoonshotAI/kimi-code#4367 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
clang:frontend code-cleanup HLSL
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
llvm/llvm-project#235100 · 1 bình luận ·
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 76/100
paritytech/polkavm#442 ·