mozcpp: parse a string literal followed by a PRI*/SCN* format macro
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 15/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 469
- Forks
- 74
- Merge médio
- 17h 16min
- PRs com merge (30d)
- 10
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de mozilla/rust-code-analysis
-
mozcpp: refresh the list of Mozilla annotation macrosTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
mozilla/rust-code-analysis#1267 ·
Mantenedores costumam responder em até 1 dia
-
Grammar check tasks compare unrelated files and skip most of the othersTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
mozilla/rust-code-analysis#1261 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
mozilla/rust-code-analysis#1250 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
mozilla/rust-code-analysis#1249 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
mozilla/rust-code-analysis#1248 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de mozilla/rust-code-analysis
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
ubugeeei-prod/vize#13586 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
storytold/photocraft#16565 ·
Mantenedores costumam responder em até 1 dia
-
flaky needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
bherbruck/solvecraft#21315 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
undergroundrap/hatchling#624 ·
Mantenedores costumam responder em até 1 dia
-
node:url: url.parse and url.resolve report name parse/resolve instead of Node's urlParse/urlResolveAbertaarea:stdlib effort:S impact:low parity type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia