@@ -37,7 +37,8 @@ table fixes
3737 toTable (reverse fixes) ++
3838 [[backtick],
3939 [binary "$" (\fc x y -> flatten $ PApp fc x [pexp y]) AssocRight],
40− [binary "=" (\fc x y -> PEq fc Placeholder Placeholder x y) AssocLeft]]
40+ [binary "=" (\fc x y -> PEq fc Placeholder Placeholder x y) AssocLeft],
41+ [nofixityoperator]]
4142 where
4243 flatten :: PTerm -> PTerm -- flatten application
4344 flatten (PApp fc (PApp _ f as) bs) = flatten (PApp fc f (as ++ bs))
@@ -80,6 +81,13 @@ backtick = Infix (do indentPropHolds gtProp
8081 fc <- getFC
8182 return (\x y -> PApp fc (PRef fc n) [pexp x, pexp y])) AssocNone
8283
84+-- | Operator without fixity (throws an error)
85+nofixityoperator :: Operator IdrisParser PTerm
86+nofixityoperator = Infix (do indentPropHolds gtProp
87+ op <- try operator
88+ unexpected $ "Operator without known fixity: " ++ op) AssocNone
89+
90+
8391{- | Parses an operator in function position i.e. enclosed by `()', with an
8492 optional namespace
8593