Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,337 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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).
主要言語
C
スター
3
フォーク
7
平均マージ
3時間 56分
マージ済み PR(30日)
102

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

InauguralSystems/EigenScript のほかの issue

InauguralSystems/EigenScript の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。