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

Multi-line f-string interpolations: spliced sub-lex enforces indentation, and lines after them are reported one early

Đã đóng
#1,337 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ó
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ả

area:runtime-vm found-by:code-review kind:silent-wrong

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.eigs agrees (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

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 InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

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.