unisonweb / unisonweb-org

Source for the unisonweb.org website
https://unisonweb.org
Other
40 stars 61 forks source link

The description of Escape Sequences in the reference is missing a bunch #330

Open pragdave opened 1 year ago

pragdave commented 1 year ago

The current list contains the single-character C escapes (\b, \r, \n etc). It's missing

(Guess who's writing a SkyLighting syntax for Unison... :)

pchiusano commented 1 year ago

Actually, I just checked the lexer, and it only supports -

escapeChars :: [(Char, Char)]
escapeChars =
  [ ('0', '\0'),
    ('a', '\a'),
    ('b', '\b'),
    ('f', '\f'),
    ('n', '\n'),
    ('r', '\r'),
    ('t', '\t'),
    ('v', '\v'),
    ('s', ' '),
    ('\'', '\''),
    ('"', '"'),
    ('\\', '\\')
  ]

So I believe the docs are correct as is.

No objections to adding other standard escape syntaxes though! Could be done in Lexer.hs

pragdave commented 1 year ago

Except they seem to work?

> "<a\SPb\x66\HT\o143\CR\LF\100>"

reports

    1 | > "<a\SPb\x66\HT\o143\CR\LF\100>"
          ⧩
          "<a bf\tc\r\nd>"

Or is this ucm accidentally using Haskell string parsing?