Formatter prints @res.doc on a function parameter as a doc comment that does not parse
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- ocaml
- Área
- compilers
Línea de trabajo
Start by tracing bsc -format from the formatter path that prints @res.doc on function parameters; compare it with how @ocaml.doc and @ns.doc are preserved, and inspect the parser around parameter doc comments. The issue permits either keeping the attribute form in formatter output or accepting the comment in the parser. Done means the shown input formats to output that parses successfully when formatted again.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The formatter prints a @res.doc attribute on a function parameter as a doc comment in front of the parameter, and the parser rejects that output.
let f = (@res.doc("The runner") run: string) => run
bsc -format prints:
let f = (
/**The runner*/
run: string,
) => run
Formatting that output again fails:
Syntax error!
2 │ /**The runner*/
3 │ run: string,
I'm not sure what to parse here when looking at "DocComment The runner".
So formatting turns a file that compiles into one that doesn't. @ocaml.doc/@ns.doc on a parameter have been formatted unchanged, because the printer prints only res.doc as a doc comment. If #8992 lands, @res.doc is the only doc attribute left, so writing it by hand on a parameter hits this. genType's tests/gentype_tests/typescript-react-example/src/Comments.res keeps @ocaml.doc on two parameters for this reason.
Either the printer keeps the attribute form for parameters, or the parser accepts a doc comment before a parameter.
Found while working on #8978.
🤖 Generated with Claude Code
- Lenguaje dominante
- OCaml
- Estrellas
- 7.5k
- Forks
- 483
- Merge medio
- 21 h 8 min
- PR fusionados (30 d)
- 183
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 rescript-lang/rescript
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rescript-lang/rescript#8996 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
rescript-lang/rescript#8997 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 55/100
rescript-lang/rescript#8995 ·
Los mantenedores suelen responder en 1 día
-
Issues from differential semantic drift analysis (a7721303 to b123b7c3)Posiblemente ocupada @cknitt la tomó hoy. Abierto
rescript-lang/rescript#8980 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Doc-comment attributes: editor analysis accepts `@ocaml.doc`/`@ns.doc`, genType and the printer do notPosiblemente ocupada @cknitt la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
rescript-lang/rescript#8978 ·
Los mantenedores suelen responder en 1 día
Todos los issues de rescript-lang/rescript
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
bug P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
numba/numba#10939 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Quantinuum/tket#2255 ·
Los mantenedores suelen responder en 1 día
-
REPL and --show-tokens abort with "Token conversion not implemented yet" on .xor., byte and in outAbiertobug low priority tokenizer
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día