diff options
| author | Andreas Källberg <anka.213@gmail.com> | 2023-09-25 09:53:59 +0200 |
|---|---|---|
| committer | Andreas Källberg <anka.213@gmail.com> | 2023-09-25 09:55:02 +0200 |
| commit | 268a25f59cd4790ef5896ddd237f0bc48f6fad26 (patch) | |
| tree | e5218b7a181dc6fef445ef1b04a4fea2d4999bff | |
| parent | 318b710a14e3bcbfb8386e4e357d4ed64b1a0ae1 (diff) | |
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
| -rw-r--r-- | src/compiler/GF/Compile/GetGrammar.hs | 3 |
1 files changed, 2 insertions, 1 deletions
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} |
