@@ -80,21 +80,21 @@ splitLevel table n e eops =
80joinL :: [LExpr t v] -> [String] -> IParser (LExpr t v)
80joinL :: [LExpr t v] -> [String] -> IParser (LExpr t v)
81joinL [e] [] = return e
81joinL [e] [] = return e
82joinL (a:b:es) (op:ops) = joinL (merge a b (Binop op a b) : es) ops
82joinL (a:b:es) (op:ops) = joinL (merge a b (Binop op a b) : es) ops
83−joinL _ _ = fail "Ill-formed binary expression. Report a compiler bug."
83+joinL _ _ = failure "Ill-formed binary expression. Report a compiler bug."
85joinR :: [LExpr t v] -> [String] -> IParser (LExpr t v)
85joinR :: [LExpr t v] -> [String] -> IParser (LExpr t v)
86joinR [e] [] = return e
86joinR [e] [] = return e
87joinR (a:b:es) (op:ops) = do e <- joinR (b:es) ops
87joinR (a:b:es) (op:ops) = do e <- joinR (b:es) ops
88 return (merge a e (Binop op a e))
88 return (merge a e (Binop op a e))
89−joinR _ _ = fail "Ill-formed binary expression. Report a compiler bug."
89+joinR _ _ = failure "Ill-formed binary expression. Report a compiler bug."
91getAssoc :: OpTable -> Int -> [(String,LExpr t v)] -> IParser Assoc
91getAssoc :: OpTable -> Int -> [(String,LExpr t v)] -> IParser Assoc
92getAssoc table n eops
92getAssoc table n eops
93 | all (==L) assocs = return L
93 | all (==L) assocs = return L
94 | all (==R) assocs = return R
94 | all (==R) assocs = return R
95 | all (==N) assocs = case assocs of [_] -> return N
95 | all (==N) assocs = case assocs of [_] -> return N
96− _ -> fail (msg "precedence")
96+ _ -> failure (msg "precedence")
97− | otherwise = fail (msg "associativity")
97+ | otherwise = failure (msg "associativity")
98 where levelOps = filter (hasLevel table n) eops
98 where levelOps = filter (hasLevel table n) eops
99 assocs = map (opAssoc table . fst) levelOps
99 assocs = map (opAssoc table . fst) levelOps
100 msg problem =
100 msg problem =