From a939251ebd3e9f1c079cd46ae78add0530b776b3 Mon Sep 17 00:00:00 2001 From: Travis Staton Date: Fri, 26 Jan 2024 12:27:56 -0500 Subject: [PATCH] don't implicitly close transclude blocks fixes #4592 --- unison-src/transcripts/fix4592.md | 4 ++-- unison-src/transcripts/fix4592.output.md | 9 ++++++--- unison-syntax/src/Unison/Syntax/Lexer.hs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/unison-src/transcripts/fix4592.md b/unison-src/transcripts/fix4592.md index 85f0aa48f9..cf272e1948 100644 --- a/unison-src/transcripts/fix4592.md +++ b/unison-src/transcripts/fix4592.md @@ -1,8 +1,8 @@ ```ucm:hide -.> builtins.merge +.> builtins.mergeio ``` -```unison:error +```unison doc = {{ {{ bug "bug" 52 }} }} ``` diff --git a/unison-src/transcripts/fix4592.output.md b/unison-src/transcripts/fix4592.output.md index b4aa51b60e..d1711bb55b 100644 --- a/unison-src/transcripts/fix4592.output.md +++ b/unison-src/transcripts/fix4592.output.md @@ -7,9 +7,12 @@ doc = {{ {{ bug "bug" Loading changes detected in scratch.u. - I found a closing '}}' here without a matching 'syntax.docTransclude'. - - 2 | 52 }} }} + 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 ``` diff --git a/unison-syntax/src/Unison/Syntax/Lexer.hs b/unison-syntax/src/Unison/Syntax/Lexer.hs index 5551069d90..21ec887ca5 100644 --- a/unison-syntax/src/Unison/Syntax/Lexer.hs +++ b/unison-syntax/src/Unison/Syntax/Lexer.hs @@ -258,7 +258,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