From: Francis Russell Date: Fri, 21 Sep 2012 00:04:05 +0000 (+0100) Subject: Make power operator right associative. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=e0cd4d63959e4a7aefbd349a265076026fd03437;p=francis%2Fofc.git Make power operator right associative. --- diff --git a/OFC/Parser.hs b/OFC/Parser.hs index 6469cce..29f893b 100644 --- a/OFC/Parser.hs +++ b/OFC/Parser.hs @@ -39,7 +39,7 @@ TokenParser { } = makeTokenParser oflDef oflOperatorTable :: OperatorTable String st Identity Expression -oflOperatorTable = [[Infix (do _ <- lSymbol "^"; return Power) AssocLeft], +oflOperatorTable = [[Infix (do _ <- lSymbol "^"; return Power) AssocRight], [Prefix (do _ <- lSymbol "-"; return Negate)], [Infix (do _ <- lSymbol "*"; return Multiply) AssocLeft ,Infix (do _ <- lSymbol "/"; return Divide) AssocLeft],