Skip to content

Commit

Permalink
cleanup and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dorchard committed Sep 12, 2024
1 parent b988c25 commit 55481c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Language/Fortran/Analysis/DataFlow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,11 @@ genConstExpMap pf = ceMap
Nothing -> map))
recursivelyProcessDecls stmts

-- Evaluate an expression down to a value
getE0 :: M.Map Name Repr.FValue -> Expression (Analysis a) -> Maybe (Repr.FValue)
getE0 pvMap e = either (const Nothing) (Just . fst) (Repr.runEvalFValuePure pvMap (Repr.evalExpr e))

-- Lookup an expression in the constants maps
getE :: Expression (Analysis a) -> Maybe Repr.FValue
getE = join . (flip IM.lookup ceMap <=< labelOf)

Expand All @@ -422,10 +424,7 @@ genConstExpMap pf = ceMap
-- TODO constants may use other constants! but genConstExpMap needs more
-- changes to support that
case Repr.runEvalFValuePure pvMap (Repr.evalExpr e) of
Left _err ->
case e of
ExpValue _ _ (ValVariable{}) -> Nothing
_ -> Nothing
Left _err -> Nothing
Right (a, _msgs) ->
case e of
ExpValue _ _ (ValVariable{}) -> Just a
Expand Down

0 comments on commit 55481c9

Please sign in to comment.