Multi-line f-string interpolations: spliced sub-lex enforces indentation, and lines after them are reported one early
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- compilers, testing-qa
Hướng nghiên cứu
Trace the C lexer paths for multi-line f-string interpolation, focusing on the spliced sub-lex indentation checks and newline accounting. Reproduce the two examples, then add regression coverage for the printed result and later diagnostic line; verify that lib/eigen.eigs agrees in the meta-parity test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found by /code-review on PR #1324, and pre-existing on main 940af49.
A multi-line f-string interpolation is re-lexed as if it were its own file. The lexer starts that text at column 0 and checks its indentation, so a continuation line that isn't aligned is a hard error, even though the layout tokens are thrown away:
print of f"{ 1 +
2}"
fails with "indentation does not match any outer level" (exit 1). #1324 makes this easier to reach, because a # comment can now end the first line.
Also, newlines inside an f-string do not advance the line counter, so every later diagnostic is reported one line early. A multi-line f-string followed by x is 1 / 0 on line 4 reports "line 3".
Done when
- The spliced sub-lex of an interpolation does not apply indentation rules; the program above prints
3. - Newlines inside an f-string advance the line counter; an error after a multi-line f-string reports its true line (regression test).
-
lib/eigen.eigsagrees (meta-parity test).
- Ngôn ngữ chính
- C
- Star
- 3
- Fork
- 7
- Merge trung bình
- 4 giờ 7 phút
- Pull request đã merge (30 ngày)
- 112
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.
- Có Dockerfile hoặc 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 InauguralSystems/EigenScript
-
area:embed kind:silent-wrong
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
InauguralSystems/EigenScript#1387 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:stdlib kind:silent-wrong
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
InauguralSystems/EigenScript#1378 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:gates kind:gate-defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
InauguralSystems/EigenScript#1374 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Error carets pad multi-byte UTF-8 byte-for-byte, so the ^ lands right of the token on a terminalĐang mởarea:lint-tooling kind:silent-wrong
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
InauguralSystems/EigenScript#1373 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:gates kind:docs-drift
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
InauguralSystems/EigenScript#1372 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InauguralSystems/EigenScript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
[Issue]: Headers - vx_ext_amd.h does not compile as C (enum types used without the enum keyword)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/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 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Qiskit/qiskit#17079 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày