diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2024-08-14 21:00:55 +0200 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2024-08-14 21:00:55 +0200 |
| commit | 53c274ad747bfbac34e979bee5f0841f9568c89f (patch) | |
| tree | e6712c05aba55600534816d5984b7f102c616e7a /protocols/codegen/Main.hs | |
| parent | f4f93ad6e9289d499e1f4c6cf7f9581e622f2d26 (diff) | |
finish codegen
Diffstat (limited to 'protocols/codegen/Main.hs')
| -rw-r--r-- | protocols/codegen/Main.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/codegen/Main.hs b/protocols/codegen/Main.hs index dbe1577..ec12592 100644 --- a/protocols/codegen/Main.hs +++ b/protocols/codegen/Main.hs @@ -45,8 +45,13 @@ writeInterface :: FlatModules -> FilePath -> TypedProtocol -> TypedInterfaceDesc writeInterface flat dir p i = do let path = dir </> (interfaceModule (fst i) ++ ".hs") let bootPath = dir </> (interfaceModule (fst i) ++ ".hs-boot") - writeFile path (generateInterface flat p i) - writeFile bootPath (generateInterfaceBoot flat p i) + let cfg = GeneratorConfig { genModules = flat + , genProtocol = p + , genInterface = fst i + , genTypes = snd i + } + writeFile path (generateInterface cfg) + writeFile bootPath (generateInterfaceBoot cfg) writeBuild :: FilePath -> [Protocol] -> IO () writeBuild path ps = writeFile path $ generateBuild ps |
