bug: namespace_definition and attributes issue
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- cpp, javascript
- Área
- compilers
Línea de trabajo
The namespace_definition rule lives in grammar.js, so start there and check where attribute_specifier is already allowed in neighbouring rules. Add optional attribute specifiers before and after the name, regenerate the parser, and confirm both repro snippets in the issue parse without ERROR nodes. Done means a corpus test in test/corpus covering both placements passes with tree-sitter test.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Did you check existing issues?
- I have read all the tree-sitter docs if it relates to using the parser
- I have searched the existing issues of tree-sitter-cpp
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
0.27.0
Describe the bug
namespace_definition symbol should be completed with optional($.attribute_specifier) before and after name field.
Steps To Reproduce/Bad Parse Tree
try to put legal c++ namespace definition to namespace __attribute__ (( __visibility__ ( default ))) ns {} to standard playground and you will get syntax error. The attribute specifier should be optionally accepted before and after name. This code copy-pasted from linux std include dir.
Expected Behavior/Parse Tree
no error
Repro
namespace __attribute__ (( __visibility__ ( default ))) ns {} // Code that causes a parse error
namespace ns __attribute__ (( __visibility__ ( default ))) {} // Code that causes a parse error too
}
- Lenguaje dominante
- JavaScript
- Estrellas
- 463
- Forks
- 196
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tree-sitter/tree-sitter-cpp
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tree-sitter/tree-sitter-cpp#374 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
tree-sitter/tree-sitter-cpp#371 · 1 comentario ·
-
`tree_sitter_cpp_external_scanner_deserialize` doesn't bound `length` against the size of the delimiter bufferPosiblemente ocupada @dekobon la tomó hace 95 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
tree-sitter/tree-sitter-cpp#368 ·
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
tree-sitter/tree-sitter-cpp#378 ·
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
tree-sitter/tree-sitter-cpp#377 · 1 comentario ·
Todos los issues de tree-sitter/tree-sitter-cpp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Automattic/node-canvas#2633 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
capricorn86/happy-dom#2594 ·
Los mantenedores suelen responder en 1 día
-
Decoding tag 1 (epoch date) with an 8-byte integer throws "Cannot mix BigInt and other types"Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
microsoft/monaco-editor#5575 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día