mozcpp: parse a string literal followed by a PRI*/SCN* format macro
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 15/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Rust
- Sterne
- 469
- Forks
- 74
- Ø Merge
- 17 Std. 16 Min.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus mozilla/rust-code-analysis
-
mozcpp: refresh the list of Mozilla annotation macrosEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
mozilla/rust-code-analysis#1267 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Grammar check tasks compare unrelated files and skip most of the othersEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
mozilla/rust-code-analysis#1261 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
mozilla/rust-code-analysis#1250 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
mozilla/rust-code-analysis#1249 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
mozilla/rust-code-analysis#1248 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in mozilla/rust-code-analysis
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
ubugeeei-prod/vize#13586 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
storytold/photocraft#16565 ·
Maintainer antworten meist innerhalb von 1 Tag
-
flaky needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
bherbruck/solvecraft#21315 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
undergroundrap/hatchling#624 ·
Maintainer antworten meist innerhalb von 1 Tag
-
node:url: url.parse and url.resolve report name parse/resolve instead of Node's urlParse/urlResolveOffenarea:stdlib effort:S impact:low parity type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag