mozcpp: refresh the list of Mozilla annotation macros
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 80/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- cpp, javascript
- Bereich
- tooling
Rechercherichtung
Die Änderung betrifft tree-sitter-mozcpp/grammar.js, und zwar das fest codierte Array der Regel macro_annotation. Füge die aufgeführten objektartigen Makros diesem Array hinzu und behalte die vorhandenen Einträge bei. Erzeuge den Parser mit tree-sitter generate neu und bestätige mit den mozcpp-Corpus-Tests, dass die vier Snippets aus dem Issue ohne ERROR-Knoten geparst werden. Fertig ist, wenn die aufgeführten Annotationen für Sichtbarkeit, Klassen, Funktionen und Variablen akzeptiert werden und die bestehenden Grammatiktests weiterhin bestehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Part of #1142 (upstream tree-sitter/tree-sitter-cpp#310: an annotation macro before a declaration produces an ERROR node).
tree-sitter-mozcpp handles this for Mozilla code with a hard-coded list of annotation macros (macro_annotation in tree-sitter-mozcpp/grammar.js). That list hasn't been updated in years. Several macros on it no longer exist in mozilla-central (MOZ_MUST_USE, MOZ_FALLTHROUGH, MOZ_ASAN_BLACKLIST, ...). They're harmless to keep for older code, but many annotation macros added since are missing. Every one of these currently produces an ERROR node:
MFBT_API void f();
class A { MOZ_KNOWN_LIVE RefPtr<B> mB; };
MOZ_RUNINIT static Foo sFoo;
class NS_NO_VTABLE nsIFoo : public nsISupports {};
They're widely used: GitHub code search finds MOZ_UNANNOTATED, MOZ_RUNINIT and MFBT_API in 100–200 files each. NS_NO_VTABLE is also in every generated XPIDL header.
Object-like macros from mfbt/Attributes.h, mfbt/Types.h, mfbt/MemoryChecking.h, mfbt/ThreadSafety.h, xpcom/base/nscore.h and js/src/jstypes.h that expand to an attribute, __declspec or visibility specifier, and are missing from the list:
- visibility/linkage:
MFBT_API,MFBT_DATA,MOZ_EXPORT,MOZ_IMPORT_API,MOZ_IMPORT_DATA,MOZ_ASAN_VISIBILITY,JS_PUBLIC_DATA,NS_EXPORT,NS_IMPORT,NS_HIDDEN,NS_EXTERNAL_VIS,NS_VISIBILITY_DEFAULT,NS_VISIBILITY_HIDDEN - class annotations:
NS_NO_VTABLE,MOZ_EMPTY_BASES,MOZ_TRIVIAL_ABI,MOZ_GSL_OWNER,MOZ_GSL_POINTER,MOZ_SCOPED_CAPABILITY - function annotations:
MOZ_NAKED,MOZ_NOINSTRUMENT,MOZ_NOPROFILE,MOZ_NOMERGE,MOZ_ASAN_IGNORE,MOZ_TSAN_IGNORE,MOZ_NO_STACK_PROTECTOR,MOZ_STANDALONE_DEBUG,MOZ_REINITIALIZES,MOZ_NO_THREAD_SAFETY_ANALYSIS,MOZ_INFALLIBLE_ALLOCATOR,MOZ_LIFETIME_BOUND,MOZ_LIFETIME_CAPTURE_BY_THIS,MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA - variable/member annotations:
MOZ_RUNINIT,MOZ_GLOBINIT,MOZ_RELEASE_CONSTINIT,MOZ_GLIBCXX_CONSTINIT,MOZ_KNOWN_LIVE,MOZ_NO_UNIQUE_ADDRESS,MOZ_UNANNOTATED,MOZ_ANNOTATED,MOZ_GUARDED_VAR,MOZ_PT_GUARDED_VAR,MOZ_NON_TERMINATED_STRING,MOZ_NULL_AFTER_MOVE
Not included on purpose: macros that expand to a type (NS_IMETHOD, NS_IMETHODIMP), calling conventions that sit after the return type (NS_FASTCALL, NS_STDCALL, ...), feature tests (MOZ_HAVE_*), and function-like macros (MOZ_GUARDED_BY(...), ...).
- 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: parse a string literal followed by a PRI*/SCN* format macroEvtl. vergeben @marco-c hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 15/100
mozilla/rust-code-analysis#1266 ·
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