aboutsummaryrefslogtreecommitdiffstats
path: root/src/Data/JLD
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/JLD')
-rw-r--r--src/Data/JLD/Flattening/NodeMap.hs26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/Data/JLD/Flattening/NodeMap.hs b/src/Data/JLD/Flattening/NodeMap.hs
index 6c35302..2e6b8e3 100644
--- a/src/Data/JLD/Flattening/NodeMap.hs
+++ b/src/Data/JLD/Flattening/NodeMap.hs
@@ -185,9 +185,9 @@ buildNodeMap' element = case element of
185 if 185 if
186 -- 6.5. 186 -- 6.5.
187 | Just referenceNode <- bnmEnvReferenceNode -> bnmModifyNodeMap \nodeMap -> 187 | Just referenceNode <- bnmEnvReferenceNode -> bnmModifyNodeMap \nodeMap ->
188 if N.memberArray bnmEnvActiveGraph bnmEnvActiveSubject bnmEnvActiveProperty (Object referenceNode) nodeMap 188 if N.memberArray bnmEnvActiveGraph (Just id') bnmEnvActiveProperty (Object referenceNode) nodeMap
189 then nodeMap 189 then nodeMap
190 else N.modifyArray bnmEnvActiveGraph bnmEnvActiveSubject bnmEnvActiveProperty (`V.snoc` Object referenceNode) nodeMap 190 else N.modifyArray bnmEnvActiveGraph (Just id') bnmEnvActiveProperty (`V.snoc` Object referenceNode) nodeMap
191 -- 6.6. 191 -- 6.6.
192 | isJust bnmEnvActiveProperty -> do 192 | isJust bnmEnvActiveProperty -> do
193 -- 6.6.1. 193 -- 6.6.1.
@@ -223,25 +223,19 @@ buildNodeMap' element = case element of
223 case KM.lookup (show KeywordIndex) elementObject' of 223 case KM.lookup (show KeywordIndex) elementObject' of
224 Just indexValue 224 Just indexValue
225 | N.hasKey3 bnmEnvActiveGraph (Just id') (Just <| show KeywordIndex) nodeMap' -> throwError <| Left ConflictingIndexes 225 | N.hasKey3 bnmEnvActiveGraph (Just id') (Just <| show KeywordIndex) nodeMap' -> throwError <| Left ConflictingIndexes
226 | otherwise -> bnmModifyNodeMap <| N.insert bnmEnvActiveGraph (Just id') (Just <| show KeywordType) indexValue 226 | otherwise -> bnmModifyNodeMap <| N.insert bnmEnvActiveGraph (Just id') (Just <| show KeywordIndex) indexValue
227 -- 227 --
228 Nothing -> pure () 228 Nothing -> pure ()
229 229
230 -- 6.9. 230 -- 6.9.
231 case KM.lookup (show KeywordReverse) elementObject' of 231 case KM.lookup (show KeywordReverse) elementObject' of
232 Just (Object reverseMap) -> do 232 Just (Object reverseMap) -> iforM_ reverseMap \key ->
233 -- 6.9.1. 233 valueToArray .> mapM_ \value ->
234 let referenced = KM.singleton (show KeywordId) (String id') 234 void <| bnmBuildNodeMap value \params ->
235 235 params
236 -- 6.9.3. 236 { bnmParamsReferenceNode = Just <| KM.singleton (show KeywordId) (String id')
237 iforM_ reverseMap \key -> 237 , bnmParamsActiveProperty = Just <| K.toText key
238 valueToArray .> mapM_ \value -> do 238 }
239 void <| bnmBuildNodeMap value \params ->
240 params
241 { bnmParamsReferenceNode = Just referenced
242 , bnmParamsActiveProperty = Just <| K.toText key
243 }
244 pure ()
245 -- 239 --
246 _ -> pure () 240 _ -> pure ()
247 241