unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.64k stars 267 forks source link

doc literals: adjacent parens change the meaning of backticks #5101

Closed ceedubs closed 1 week ago

ceedubs commented 1 week ago

Describe and demonstrate the bug

Backticks are used to indicate code in doc literals, but putting them inside a parenthetical causes them to be treated as ordinary text. Adding a space between the parentheses and the backticks makes them behave as expected, but it shouldn't need to be there.

> {{
( `foo` )

(`foo`)
}}

  Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels.

    1 | > {{
          ⧩
          UntitledSection
            [Paragraph [Word "(", Code (Word "foo"), Word ")"], Paragraph [Word "(`foo`)"]]

Environment (please complete the following information):

Additional context

This is very similar to https://github.com/unisonweb/unison/issues/4633

ceedubs commented 1 week ago

Oh this also looks closely related to #4993.

ceedubs commented 1 week ago

Oh actually I think that this is a duplicate of #4777 , which I failed to find when I created this.