Show String outputs illegal escape sequence \& in string literals

Offen
#258 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

  • #293 von @JordanMartinez — ohne Merge geschlossen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
haskell
Bereich
backend

Rechercherichtung

The issue describes a mismatch between REPL output and compiler input, but names no files or tests. Start by locating the string literal escape parser and the REPL string rendering code, then trace how numeric escapes are parsed. Done means the compiler accepts the zero-width escape used in REPL output; the issue gives no specific test command.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

purs-0.15 type: breaking change type: bug

Description

The REPL outputs string literals containing the escape sequence \& but this escape sequence is not accepted as input.

To Reproduce

In the REPL:

> "\x0000001"
"\0\&1"

> "\0\&1"
Illegal character escape code at line 1, column 3

Expected behavior

The REPL outputs valid string literals.

Additional context

Haskell supports \& to delimit a numeric escape sequence from the following characters, see The zero-width escape sequence. This is exactly the way in which the PureScript REPL uses \& to produce canonicalized string literals. However the compiler does not actually accept this escape sequence. If it did this would provide a solution to the problem in purescript/purescript#3750.

PureScript version

0.13.8

Vorherrschende Sprache
PureScript
Sterne
168
Forks
90
Ø Merge
3 T. 1 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus purescript/purescript-prelude

Alle Issues in purescript/purescript-prelude

Ähnliche Issues

Weitere Issues zu Backend & API Design

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.