-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only process modules that are reachable from exposed ones (#40)
* Added missing module declarations. #37 * Process only those modules that are reachable from exposed ones. Remove package path from module names. #21
- Loading branch information
1 parent
1522465
commit 8490534
Showing
9 changed files
with
259 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "morphir", | ||
"name": "Morphir", | ||
"sourceDirectory": "src", | ||
"exposedModules": [ | ||
"Morphir.IR.Name", | ||
"Morphir.IR.Path" | ||
"IR.Advanced.Type", | ||
"IR.Advanced.Value" | ||
] | ||
} |
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,39 @@ | ||
module Morphir.IR.SDK.Char exposing (..) | ||
|
||
import Dict | ||
import Morphir.IR.Advanced.Module as Module | ||
import Morphir.IR.Advanced.Type exposing (Declaration(..), Type(..)) | ||
import Morphir.IR.FQName as FQName exposing (FQName) | ||
import Morphir.IR.Name as Name | ||
import Morphir.IR.Path exposing (Path) | ||
import Morphir.IR.QName as QName | ||
import Morphir.IR.SDK.Common exposing (packageName) | ||
|
||
|
||
moduleName : Path | ||
moduleName = | ||
[ [ "char" ] ] | ||
|
||
|
||
moduleDeclaration : Module.Declaration () | ||
moduleDeclaration = | ||
{ types = | ||
Dict.fromList | ||
[ ( [ "char" ], OpaqueTypeDeclaration [] ) | ||
] | ||
, values = | ||
Dict.empty | ||
} | ||
|
||
|
||
fromLocalName : String -> FQName | ||
fromLocalName name = | ||
name | ||
|> Name.fromString | ||
|> QName.fromName moduleName | ||
|> FQName.fromQName packageName | ||
|
||
|
||
charType : extra -> Type extra | ||
charType extra = | ||
Reference (fromLocalName "char") [] extra |
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,44 @@ | ||
module Morphir.IR.SDK.Result exposing (..) | ||
|
||
import Dict | ||
import Morphir.IR.Advanced.Module as Module | ||
import Morphir.IR.Advanced.Type as Type exposing (Declaration(..), Type(..)) | ||
import Morphir.IR.FQName as FQName exposing (FQName) | ||
import Morphir.IR.Name as Name | ||
import Morphir.IR.Path exposing (Path) | ||
import Morphir.IR.QName as QName | ||
import Morphir.IR.SDK.Common exposing (packageName) | ||
|
||
|
||
moduleName : Path | ||
moduleName = | ||
[ [ "result" ] ] | ||
|
||
|
||
moduleDeclaration : Module.Declaration () | ||
moduleDeclaration = | ||
{ types = | ||
Dict.fromList | ||
[ ( [ "result" ] | ||
, CustomTypeDeclaration [ [ "e" ], [ "a" ] ] | ||
[ ( [ "ok" ], [ ( [ "value" ], Type.Variable [ "a" ] () ) ] ) | ||
, ( [ "err" ], [ ( [ "error" ], Type.Variable [ "e" ] () ) ] ) | ||
] | ||
) | ||
] | ||
, values = | ||
Dict.empty | ||
} | ||
|
||
|
||
fromLocalName : String -> FQName | ||
fromLocalName name = | ||
name | ||
|> Name.fromString | ||
|> QName.fromName moduleName | ||
|> FQName.fromQName packageName | ||
|
||
|
||
resultType : Type extra -> extra -> Type extra | ||
resultType itemType extra = | ||
Reference (fromLocalName "result") [ itemType ] extra |
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
Oops, something went wrong.