Formatter drops a comment before the spread of a list pattern like `list{/* c */ ...r}`
Maintainer antworten meist innerhalb von 1 Tag
Ein zugehöriger Pull Request wurde bereits gemerged.
- #9127 von @cknitt — gemerged
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- ocaml
- Bereich
- compilers
Rechercherichtung
Start by reading the formatter and pattern printing code for list patterns, then trace how comments attached to a spread are handled when list{...r} parses to r. Reproduce with the supplied bsc -format example and compare it with the expression case and the list{a, /* e */ ...r} case. Done means formatting preserves /* d */ in the pattern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Formatting drops a comment written before the spread of a list pattern that has no other items.
let f = x =>
switch x {
| list{/* d */ ...r} => r
}
bsc -format (master at 3562ce6b80) prints:
let f = x =>
switch x {
| r => r
}
The comment /* d */ is gone. list{...r} parses to the pattern r itself, so the printer prints r, and the comment attached to the spread is never printed. The expression list{/* h */ ...xs} keeps its comment (/* h */ xs), and list{a, /* e */ ...r} keeps it too (with #9119).
Found while working on #9107; #9119 does not change this case.
🤖 Generated with Claude Code
- Vorherrschende Sprache
- OCaml
- Sterne
- 7.5k
- Forks
- 484
- Ø Merge
- 20 Std. 43 Min.
- Gemergte PRs (30 T.)
- 263
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
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 rescript-lang/rescript
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
rescript-lang/rescript#9139 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
rescript-lang/rescript#9151 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Printed @as names of fields and constructors turn non-ASCII letters into other charactersEvtl. vergeben @cknitt hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
rescript-lang/rescript#9142 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
rescript-lang/rescript#9130 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 55/100
rescript-lang/rescript#9122 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in rescript-lang/rescript
Ähnliche Issues
-
JS/TS: JSX props compile errors should link to a doc page explaining the static-list requirementOffenarea: js-runtime enhancement exists-upstream interop priority: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
shayanhabibi/fickl#307 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug fmt low priority
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
bot-triaged module: inductor oncall: pt2 topic: fuzzer triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
microsoft/DirectXShaderCompiler#9087 ·
Maintainer antworten meist innerhalb von 1 Tag
-
confirmed generated by fuzzer llvm:codegen miscompilation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
llvm/llvm-project#237380 ·
Maintainer antworten meist innerhalb von 1 Tag