Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

editors: escaped f-string braces are highlighted as interpolation

已关闭
#1,241 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
vim, vscode
领域
tooling

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

area:lint-tooling bug good first issue help wanted

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.

主要语言
C
星标
3
派生
7
平均合并
4 小时 15 分钟
30 天内合并 PR
106

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

InauguralSystems/EigenScript 的其他 Issue

查看 InauguralSystems/EigenScript 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。