mozcpp: parse a string literal followed by a PRI*/SCN* format macro
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
The failing case is test_fn_id_strings in src/c_langs_macros/mod.rs, currently marked #[ignore]. The grammar change belongs in the tree-sitter-mozcpp dependency, where concatenated_string must accept PRI*/SCN* macros after a string literal. Done means the ignore is removed and the test passes. Pull request #1269 already targets this fix, so check it before starting.
索引モデルが issue の本文から書いたものです。
説明
Part of #1142 (upstream tree-sitter/tree-sitter-cpp#307).
The C++ grammar only accepts an identifier before a string literal in a concatenated_string, so PRIi32 "%" parses but "%" PRIi32 produces an ERROR node:
nsPrintfCString("%" PRIi32, lifetime.mTag);
This is one of the most common patterns in mozilla-central: the <inttypes.h> format macros (PRIu32, PRIx64, PRId64, ...) are used after a string literal throughout MOZ_LOG, nsPrintfCString, printf_stderr, SprintfLiteral and similar calls. test_fn_id_strings in src/c_langs_macros/mod.rs covers exactly this case and has been #[ignore]d since #1141.
Replacing predefined macros with $ characters (c_macro::replace) doesn't help: "%" $$$$$$ fails the same way. And it's only applied when preprocessor results are available anyway.
Allowing any identifier after a string literal would be ambiguous with things like extern "C" MOZ_EXPORT void f();. A narrower fix in tree-sitter-mozcpp is to accept the <inttypes.h> format macros (PRI*/SCN*) as members of a concatenated_string, and then un-ignore test_fn_id_strings.
- 主要言語
- Rust
- スター
- 469
- フォーク
- 74
- 平均マージ
- 17時間 16分
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mozilla/rust-code-analysis のほかの issue
-
mozcpp: refresh the list of Mozilla annotation macros対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
mozilla/rust-code-analysis#1267 ·
メンテナーはふだん 1 日以内に返信
-
Grammar check tasks compare unrelated files and skip most of the others再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
mozilla/rust-code-analysis#1261 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
mozilla/rust-code-analysis#1250 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
mozilla/rust-code-analysis#1249 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
mozilla/rust-code-analysis#1248 ·
メンテナーはふだん 1 日以内に返信
mozilla/rust-code-analysis の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ubugeeei-prod/vize#13586 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
storytold/photocraft#16565 ·
メンテナーはふだん 1 日以内に返信
-
flaky needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
bherbruck/solvecraft#21315 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
undergroundrap/hatchling#624 ·
メンテナーはふだん 1 日以内に返信
-
node:url: url.parse and url.resolve report name parse/resolve instead of Node's urlParse/urlResolveオープンarea:stdlib effort:S impact:low parity type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信