editors: escaped f-string braces are highlighted as interpolation
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
- 75/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ệ
- vim, vscode
- Lĩnh vực
- tooling
Hướng nghiên cứu
Start with editors/vscode/syntaxes/eigenscript.tmLanguage.json and editors/vim/syntax/eigenscript.vim, using the lexer f-string escape handling in src/lexer.c as the behavior contract. Reproduce the supplied f-string fixture and inspect scopes before and after in both grammars, with VS Code semantic tokens disabled. Done means escaped braces remain literal, genuine interpolation is scoped as an expression, and existing string escapes continue to work.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The bundled editor grammars treat an escaped opening brace in an f-string as the start of interpolation. EigenScript's lexer treats \{ and \} as literal braces.
Reproduce
print of f"literal \{name\}"
The runtime prints literal {name} without looking up a variable called name. In the VS Code grammar, the f-string escape pattern does not consume the backslash-plus-brace, so the interpolation pattern matches the following {. The Vim escape declaration omits braces too.
Checked at b91768e23c5a874a64e76e4af9ab291e6aa49983:
The runtime output and exact VS Code regex behavior were checked; this report does not claim a GUI/TextMate-engine verification.
First-contribution scope
Correct the two editor grammars so escaped braces retain their string/escape scope and do not start interpolation when they occur in the f-string's literal text. Use the existing lexer behavior as the contract; handling of braces inside an expression is outside this issue. No runtime change is required.
Done when
- Escaped opening and closing braces remain literal f-string content.
- Genuine interpolation still receives an expression scope.
- Mixed literal and interpolated segments work, including an escaped backslash immediately before a genuine interpolation.
- Plain strings and existing quote/backslash escapes keep their behavior.
- Provide a small fixture and before/after scope inspection for both grammars, including VS Code with semantic tokens disabled.
This is suitable for a contributor familiar with regular expressions and editor configuration. It shares files with #1233 and #1234; keep the fix focused and coordinate/rebase if one lands first.
- 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 90/100
BasedHardware/omi#19711 ·
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 85/100
microsoft/ebpf-for-windows#5604 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
trezor/trezor-firmware#7985 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/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 70/100
Maintainer thường phản hồi trong vòng 2 ngày