Skip to content

Track the source offset of each token and expose it in syntax errors - #4834

Merged
fabpot merged 3 commits into
twigphp:3.xfrom
fabpot:offset-on-tokens
Jun 6, 2026
Merged

Track the source offset of each token and expose it in syntax errors#4834
fabpot merged 3 commits into
twigphp:3.xfrom
fabpot:offset-on-tokens

Conversation

@fabpot

@fabpot fabpot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@fabpot
fabpot force-pushed the offset-on-tokens branch 5 times, most recently from e7d0712 to 49923cc Compare June 5, 2026 18:23
@fabpot
fabpot force-pushed the offset-on-tokens branch from 49923cc to a82782a Compare June 5, 2026 18:29
@fabpot
fabpot merged commit e3c0c3f into twigphp:3.x Jun 6, 2026
42 of 43 checks passed
@fabpot
fabpot deleted the offset-on-tokens branch June 6, 2026 06:56
ttokoro20240902 added a commit to EC-CUBE/ec-cube that referenced this pull request Aug 5, 2026
twig/twig 3.28.0 で「Report the column number in syntax errors」
(twigphp/Twig#4834) が入り、SyntaxError のメッセージ末尾が
`at line N` から `at line N column M` に変わった。

TwigLintValidatorTest::testInValidTemplate が末尾の句点まで含めて
アサートしていたため、composer.lock の twig 3.27.0 -> 3.28.0 で
PHPUnit の全マトリクスが fail していた。

composer.json の制約は `"twig/twig": "^3.21"` で 3.28 未満も許容するため、
版差で変わらない行番号までを含有判定に変更する。
`{% endfo %}` 側は 3.28.0 でも column が付かないが、同種の破綻を避けて
同じ書き方に揃える。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ttokoro20240902 added a commit to EC-CUBE/ec-cube that referenced this pull request Aug 6, 2026
#7013 のマージで esbuild が入ったので、eccube-asset の記述を
esbuild.config.mjs とリポジトリの実体で 1 項目ずつ照合した。
実体と合っていなかった点、および実装にあって書かれていなかった点を直す。

eccube-asset

- 「対象」の SCSS ソースに install を挙げていたが、
  html/template/install に scss ディレクトリは存在せず JS エントリだけ。
  SCSS は default / admin の 2 つに訂正する。
- 「生成物」を html/template/*/assets/css/*.css と広く書いていたが、
  実際に scss から生成されるのは style.* / app.* / bootstrap.* の 3 系統のみ。
  install/assets/css/dashboard.css と
  admin/assets/css/tempusdominus-bootstrap-4*.css は対応する scss が無い
  手管理ファイルで、再ビルドしても更新されない。両者を書き分ける。
- 上記を踏まえ「css/ 配下すべてを生成物と決めつける」を「よくある間違い」に追加。

eccube-contributing

- .husky/pre-push は dev コンテナ XML が無いとき先に
  bin/console cache:clear --env=dev を実行する(無いと rector が全ファイル
  read error で落ちるため)。初回 push が長い理由が分からないと
  異常と誤認するので追記する。

eccube-phpunit

- 依存ライブラリの例外メッセージを全文アサートしない、を追加。
  twig/twig 3.28.0 の「Report the column number in syntax errors」
  (twigphp/Twig#4834) で `at line N.` が `at line N column M.` に変わり、
  composer.lock の更新だけで PHPUnit の全マトリクスが落ちた実例がある。
  composer.json の制約は ^3.21 で 3.28 も許容するため、版差で変わらない
  部分だけを含有判定する。

なお TwigLintValidatorTest 自体の修正は #7024 に含まれるため本 PR では触らない。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant