-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One step closer to singularity (#69)
* Added missing module declarations. #37 * Process only those modules that are reachable from exposed ones. Remove package path from module names. #21 * Renaming concepts based on review feedback. #41 * Moved Advanced module up a level. #43 * Removed unused unindent function. * Moved name to SDK. * Added missing module to SDK. * Partial implementation of value mapping. * Ignore all generated JS. * Change extra arg position and naming. #46, #25 * Change extra arg position and naming. #46, #25 * Removed remaining references to extra. #5 * Change extra arg position. #46, #25, #5 * Added more coverage. #46, #25, #5 * Changes suggested in the PR. #46, #25, #5 * Use more explicit names. * All patterns supported. * Pattern-match supported. * Added support for SDK operators. #52 * Fix compile errors. * Prepare Elm module publishing. #2 * Fix repo name. #2 * Support for let expressions. #54 * Simple join implementations. #64 * Refactoring to make the code more organized. * Refactoring to make the code more organized. * Prepare value mapping utils. #53 * More descriptive naming. * More descriptive naming. * Removed unused function * Better naming * Added utility function and removed unused one. * Added variable resolution. * Hooked up variable resolution and updated tests. #53 * Completed reference resolution. #53 * Added missing docs and refactored. #68 * Document and refactor driven by the goal to process Morphir using Morphir. #68
- Loading branch information
1 parent
f92b5f1
commit 7731cb3
Showing
41 changed files
with
1,794 additions
and
1,739 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,45 @@ | ||
module Morphir.IR.AccessControlled.Codec exposing (..) | ||
|
||
{-| Encode AccessControlled to JSON. | ||
-} | ||
|
||
import Json.Decode as Decode | ||
import Json.Encode as Encode | ||
import Morphir.IR.AccessControlled exposing (Access(..), AccessControlled) | ||
|
||
|
||
encodeAccessControlled : (a -> Encode.Value) -> AccessControlled a -> Encode.Value | ||
encodeAccessControlled encodeValue ac = | ||
case ac.access of | ||
Public -> | ||
Encode.list identity | ||
[ Encode.string "Public" | ||
, encodeValue ac.value | ||
] | ||
|
||
Private -> | ||
Encode.list identity | ||
[ Encode.string "Private" | ||
, encodeValue ac.value | ||
] | ||
|
||
|
||
{-| Decode AccessControlled from JSON. | ||
-} | ||
decodeAccessControlled : Decode.Decoder a -> Decode.Decoder (AccessControlled a) | ||
decodeAccessControlled decodeValue = | ||
Decode.index 0 Decode.string | ||
|> Decode.andThen | ||
(\tag -> | ||
case tag of | ||
"Public" -> | ||
Decode.map (AccessControlled Public) | ||
(Decode.index 1 decodeValue) | ||
|
||
"Private" -> | ||
Decode.map (AccessControlled Private) | ||
(Decode.index 1 decodeValue) | ||
|
||
other -> | ||
Decode.fail <| "Unknown access controlled type: " ++ other | ||
) |
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,29 @@ | ||
module Morphir.IR.FQName.Codec exposing (..) | ||
|
||
{-| Encode a fully-qualified name to JSON. | ||
-} | ||
|
||
import Json.Decode as Decode | ||
import Json.Encode as Encode | ||
import Morphir.IR.FQName exposing (FQName(..)) | ||
import Morphir.IR.Name.Codec exposing (decodeName, encodeName) | ||
import Morphir.IR.Path.Codec exposing (decodePath, encodePath) | ||
|
||
|
||
encodeFQName : FQName -> Encode.Value | ||
encodeFQName (FQName packagePath modulePath localName) = | ||
Encode.list identity | ||
[ packagePath |> encodePath | ||
, modulePath |> encodePath | ||
, localName |> encodeName | ||
] | ||
|
||
|
||
{-| Decode a fully-qualified name from JSON. | ||
-} | ||
decodeFQName : Decode.Decoder FQName | ||
decodeFQName = | ||
Decode.map3 FQName | ||
(Decode.index 0 decodePath) | ||
(Decode.index 1 decodePath) | ||
(Decode.index 2 decodeName) |
Oops, something went wrong.