Document token spacing
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 28/100
- Tipo de issue
- Documentación
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- rust
- Área
- documentation
Línea de trabajo
Comienza con el capítulo del lexer y la sección existente macro.proc.token.conversion.from-proc_macro; después inspecciona en rustc_parse/src/parser/mod.rs la zona alrededor de break_and_eat. Compara el tratamiento de los tokens unidos en el resumen de sintaxis con los patrones de referencia y los operadores de préstamo, y revisa las issues y pull requests enlazadas. Se considera terminado cuando la Reference define claramente el espaciado de los tokens, su división o unión, y los límites entre el lexer y el parser.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I think the behavior around token splitting should be documented in some way, though I'm uncertain exactly how. The general idea is that the lexer chapter defines tokens, such as <-, which are then split in certain situations to smaller tokens. AFAIK, the reference doesn't really define how this works. I also don't know how much of this is part of the lexer versus the parser. I suspect it needs to be addressed in both depending on which approach we take.
A question I have is whether it should be documented as tokens being split, or tokens being glued, since I could imagine either approach is viable.
I think in rustc, currently the primary method that is used to handle this is break_and_eat. However, I may be misremembering if there are other places where this is handled.
IIUC, the places where this splitting happens is somewhat arbitrary, in terms of places where people thought it would be helpful. There's nothing that prevents the parser from avoiding those splitting methods.
There is a brief mention in macro.proc.token.conversion.from-proc_macro how proc-macro output is glued/split. The proc-macro Spacing type briefly touches on it as well.
Note that reference patterns and borrow operators specifically include the && token in their grammar. I don't remember the exact details about why we did it that way (that is, why did we do this just for && and no other token?). Depending on how we approach this, we may need to consider how that might need to change.
Note that I included some of the jointed tokens in the syntax summary. We may want to remove some. For example, I have >>= and >= linking to generics.
Some relevant links:
- Lenguaje dominante
- Rust
- Estrellas
- 1.6k
- Forks
- 618
- Merge medio
- 5 h 48 min
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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 rust-lang/reference
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Document the rules for const UBAbiertoA-const-eval A-undefined-behavior
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rust-lang/reference#2266 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
A-resolve
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
Todos los issues de rust-lang/reference
Issues similares
-
bug priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
storytold/photocraft#12706 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
IngvarConsulting/unica#2822 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Clean master build fails in zune-jpeg error conversion and zero-IV array construction (patch)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100