@@ -93,12 +93,14 @@ getAssoc 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
96+ _ -> fail (msg "precedence")
97+ | otherwise = fail (msg "associativity")
97 where levelOps = filter (hasLevel table n) eops
98 where levelOps = filter (hasLevel table n) eops
98 assocs = map (opAssoc table . fst) levelOps
99 assocs = map (opAssoc table . fst) levelOps
99− msg = concat [ "Conflicting precedence for binary operators ("
101+ concat [ "Conflicting " ++ problem ++ " for binary operators ("
100− , intercalate ", " (map fst eops), "). "
102+ , intercalate ", " (map fst eops), "). "
101− , "Consider adding parentheses to disambiguate." ]
103+ , "Consider adding parentheses to disambiguate." ]
103infixStmt :: IParser (Int, Assoc, String)
105infixStmt :: IParser (Int, Assoc, String)
104infixStmt =
106infixStmt =