summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-07-24 02:57:15 +1000
committerJed Barber <jjbarber@y7mail.com>2014-07-24 02:57:15 +1000
commit79fbf24fd6ab9965eb8374a06f01daf304788abe (patch)
tree33a1fc1189ec94c218f6e8455cfc5e8f6ac407e6
parent25eb3e6e8ceeb8b6bf84f5e863dcb94c8decadb4 (diff)
Fixed cond handling
-rw-r--r--src/Grasp/Interpreter.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Grasp/Interpreter.hs b/src/Grasp/Interpreter.hs
index 56ead7b..03a2978 100644
--- a/src/Grasp/Interpreter.hs
+++ b/src/Grasp/Interpreter.hs
@@ -66,7 +66,7 @@ execute g ([]:ips) out = execute g ips out
execute g (cur:rest) out =
let (node,instruction) = head cur
condL = targetLabels g (getByLabel "cond" (Graph.out g node))
- goAhead = all (\x -> isJust (readMaybe x >>= return . (/= 0.0))) condL
+ goAhead = all (\x -> isFloat x && (read :: String -> Float) x /= 0.0) condL
in case (goAhead, instruction) of
(False,_) -> do