diff options
| author | Inari Listenmaa <inari.listenmaa@gmail.com> | 2023-09-25 17:29:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-25 17:29:50 +0200 |
| commit | 7d9015e2e159b376cf2ba8332093c9623375557e (patch) | |
| tree | 808be3297a56011a967153c608a329db31c3d669 /src/compiler/GF | |
| parent | 318b710a14e3bcbfb8386e4e357d4ed64b1a0ae1 (diff) | |
| parent | cf1ef40789fc6761e46ecac1215cdb018972f2ae (diff) | |
Merge pull request #161 from anka-213/indent-errors
Indent each line of error messages
Diffstat (limited to 'src/compiler/GF')
| -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} |
