forked from awakesecurity/gRPC-haskell
-
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 DotProto.Generate (awakesecurity#104)
This PR moves the non-Haskell specific code generator utilities from `DotProto.Generate` to `DotProto.Internal`. I've gone through the `DotProto.Generate` module and made stylistic improvements---the changes are largely cosmetic. This refactor also paves the way for a Purescript code generator feature that I'm hacking on. Major changes: - Pass args struct to `compileDotProtoFile` runner - Enforce that `Path` is nonempty using `List.NonEmpty`. This removes a case from `CompileError` - Nice combinators for writing `importDecl_` statements (see `defaultImports`) - Pass file name to parsec; report file name in parser errors - Make `DotProtoServiceRPC` args a separate type - Clarify codegen steps using `foldMapM` and `foldMapOfM`. This might also improve efficiency by causing separate traversal steps (e.g. map -> sequence -> mconcat) to be done in a single pass, depending on what ghc was doing with the original code... - Improve readability and organisation of large codegen functions The version has been updated to `0.3.0.1` to reflect minor changes in types and dependencies.
- Loading branch information
1 parent
a05d6a3
commit 2dd8a7a
Showing
12 changed files
with
1,583 additions
and
1,495 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{-# LANGUAGE TemplateHaskell #-} | ||
module Proto3.Suite.DotProto.AST.Lens where | ||
|
||
import Control.Lens.TH | ||
import Proto3.Suite.DotProto.AST | ||
|
||
makePrisms ''DotProtoDefinition | ||
makePrisms ''DotProtoMessagePart | ||
|
Oops, something went wrong.