Skip to content

Commit

Permalink
Merge pull request #4643 from unisonweb/travis/4592/roundtrip-bug-in-…
Browse files Browse the repository at this point in the history
…docs

Don't implicitly close transclude blocks
  • Loading branch information
aryairani authored Jan 26, 2024
2 parents 750e35c + a939251 commit aec8aec
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
8 changes: 8 additions & 0 deletions unison-src/transcripts/fix4592.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```ucm:hide
.> builtins.mergeio
```

```unison
doc = {{ {{ bug "bug"
52 }} }}
```
18 changes: 18 additions & 0 deletions unison-src/transcripts/fix4592.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```unison
doc = {{ {{ bug "bug"
52 }} }}
```

```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
doc : Doc2
```
2 changes: 1 addition & 1 deletion unison-syntax/src/Unison/Syntax/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ token'' tok p = do
topHasClosePair :: Layout -> Bool
topHasClosePair [] = False
topHasClosePair ((name, _) : _) =
name `elem` ["{", "(", "[", "handle", "match", "if", "then"]
name `elem` ["syntax.docTransclude", "{", "(", "[", "handle", "match", "if", "then"]

showErrorFancy :: (P.ShowErrorComponent e) => P.ErrorFancy e -> String
showErrorFancy (P.ErrorFail msg) = msg
Expand Down

0 comments on commit aec8aec

Please sign in to comment.