Printed @as names of fields and constructors turn non-ASCII letters into other characters
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #9143 của @cknitt — đã merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start with Printtyp.tree_of_constructor and Res_outcome_printer, the two printer locations named in the issue, and compare their escaping with String_literal.encode_js_string, which is used for @tag names. Check how non-ASCII @as names appear in printed interfaces, errors, and hover; done means they preserve the original runtime names when read back. Linked pull request #9143 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When a type declaration is printed (error messages, hover, createInterface), the @as names of record fields and variant constructors are escaped the OCaml way (%S in Printtyp.tree_of_constructor, String.escaped in Res_outcome_printer). Non-ASCII bytes become decimal escapes like \195\169, which ReScript reads back as different characters.
module Make = (X: {type t}) => {
type record = {@as("prénom") name: X.t}
type variant = | @as("é") E | @as("a\"b") Q
}
module Applied = Make({
type t = string
})
createInterface prints the types of Applied through this printer:
module Applied: {
type record = {@as("pr\195\169nom") name: string}
type variant = @as("\195\169") E | @as("a\"b") Q
}
Read back, @as("pr\195\169nom") names the field prénom:
type record = {@as("pr\195\169nom") name: string}
let r = {name: "x"}
compiles to
let r = {
"prénom": "x"
};
so a generated interface gives the fields and constructors other runtime names than the implementation. Error messages and hover show the escapes too.
The @tag name of a declaration is printed with String_literal.encode_js_string since #9136, which keeps non-ASCII letters and escapes only what a string literal needs.
- Ngôn ngữ chính
- OCaml
- Star
- 7.5k
- Fork
- 484
- Merge trung bình
- 17 giờ 2 phút
- Pull request đã merge (30 ngày)
- 249
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#9151 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ 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#9130 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
rescript-lang/rescript#9122 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dev dependencies interactingCó thể đã có người làm @CarlOlson đã nhận 6 ngày trước. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 25/100
rescript-lang/rescript#9089 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ 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#9074 ·
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ự
-
Won't Fix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/TypeScript#65107 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`color-mix(var(--color-red-500))` crashes the build with `Cannot read properties of undefined (reading 'kind')`Có thể đã có người làm @zerotohero3 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
tailwindlabs/tailwindcss#20657 ·
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 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage type: bug
Độ 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
-
bug scope:diagnostics
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày