From 53c274ad747bfbac34e979bee5f0841f9568c89f Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Wed, 14 Aug 2024 21:00:55 +0200 Subject: finish codegen --- protocols/codegen/Main.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'protocols/codegen/Main.hs') 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 -- cgit v1.3.1