generated from srid/haskell-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor converter result to support emitting warnings/errors in a ni…
…ce way
- Loading branch information
1 parent
edad597
commit 985a46a
Showing
7 changed files
with
59 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
templatespiler-converter/src/Templatespiler/Emit/Common.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
module Templatespiler.Emit.Common where | ||
|
||
import Prettyprinter (Doc) | ||
import Prettyprinter.Render.Terminal (AnsiStyle) | ||
|
||
indentDepth :: Int | ||
indentDepth = 4 | ||
|
||
type TDoc = Doc () | ||
type PDoc = Doc AnsiStyle | ||
|
||
data ConvertResult | ||
= ConversionFailed PDoc | ||
| ConvertResult | ||
{ warnings :: [PDoc] | ||
, code :: TDoc | ||
} | ||
deriving stock (Show) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters