-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c50d681
commit 7fa24e3
Showing
7 changed files
with
127 additions
and
11 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
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,26 @@ | ||
{-# OPTIONS_GHC -Wno-unused-imports #-} | ||
{-# OPTIONS_GHC -Wno-unused-local-binds #-} | ||
{-# OPTIONS_GHC -Wno-unused-top-binds #-} | ||
|
||
module NammaDSL.Generator.Purs.Common where | ||
|
||
import Data.Maybe (fromMaybe) | ||
import Data.Text (Text, pack) | ||
import qualified Data.Text as T | ||
import NammaDSL.DSL.Syntax.Frontend.Purs | ||
import NammaDSL.DSL.Syntax.TechDesign | ||
import NammaDSL.Generator.Purs.CST | ||
import Prelude | ||
|
||
class ToChange a where | ||
toChange :: a -> [Change] | ||
|
||
instance ToChange PursType where | ||
toChange (PursType {..}) = | ||
[AddRecord _ptypeOf (pack _ptypeName)] | ||
++ map (\(PursField n t) -> AddField (pack _ptypeName) (pack n) (pack t)) _ptypeFields | ||
|
||
instance ToChange PursDefaultObj where | ||
toChange (PursDefaultObj {..}) = | ||
[AddRecord _pdefaultObjType (pack _pdefaultObjName)] -- TODO: Need to add default addition in cst | ||
++ map (\(PursField n t) -> AddField (pack _pdefaultObjName) (pack n) (pack t)) _pdefaultFieldsValue |
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,13 @@ | ||
{-# OPTIONS_GHC -Wno-unused-imports #-} | ||
{-# OPTIONS_GHC -Wno-unused-local-binds #-} | ||
{-# OPTIONS_GHC -Wno-unused-top-binds #-} | ||
|
||
module NammaDSL.Generator.Purs.Component where | ||
|
||
import Data.Maybe (fromMaybe) | ||
import Data.Text (Text, pack) | ||
import qualified Data.Text as T | ||
import NammaDSL.DSL.Syntax.Frontend.Purs | ||
import NammaDSL.DSL.Syntax.TechDesign | ||
import NammaDSL.Generator.Purs.CST | ||
import Prelude |