From 268a25f59cd4790ef5896ddd237f0bc48f6fad26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Mon, 25 Sep 2023 09:53:59 +0200 Subject: [PATCH] Indent each line of an error message By indenting each line instead of just the first, we simplify the work of the gf-lsp parser, so we can see which errors are the same --- src/compiler/GF/Compile/GetGrammar.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/GF/Compile/GetGrammar.hs b/src/compiler/GF/Compile/GetGrammar.hs index 191c3aff9..a7fd3de72 100644 --- a/src/compiler/GF/Compile/GetGrammar.hs +++ b/src/compiler/GF/Compile/GetGrammar.hs @@ -42,11 +42,12 @@ getSourceModule opts file0 = raw <- liftIO $ keepTemp tmp --ePutStrLn $ "1 "++file0 (optCoding,parsed) <- parseSource opts pModDef raw + let indentLines = unlines . map (" "++) . lines case parsed of Left (Pn l c,msg) -> do file <- liftIO $ writeTemp tmp cwd <- getCurrentDirectory let location = makeRelative cwd file++":"++show l++":"++show c - raise (location++":\n "++msg) + raise (location++":\n" ++ indentLines msg) Right (i,mi0) -> do liftIO $ removeTemp tmp let mi =mi0 {mflags=mflags mi0 `addOptions` opts, msrc=file0}