File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -358,17 +358,17 @@ parseValueAtom = P.choice
358358 , parseOperatorSection ]
359359
360360-- |
361- -- Parse an identifier in backticks or an operator
361+ -- Parse an expression in backticks or an operator
362362--
363- parseIdentInfix :: TokenParser Expr
364- parseIdentInfix = P. between tick tick parseValue
365- <|> Var <$> parseQualified (Op <$> symbol)
363+ parseInfixExpr :: TokenParser Expr
364+ parseInfixExpr = P. between tick tick parseValue
365+ <|> Var <$> parseQualified (Op <$> symbol)
366366
367367parseOperatorSection :: TokenParser Expr
368368parseOperatorSection = parens $ left <|> right
369369 where
370- right = OperatorSection <$> parseIdentInfix <* indented <*> (Right <$> parseValueAtom)
371- left = flip OperatorSection <$> (Left <$> parseValueAtom) <* indented <*> parseIdentInfix
370+ right = OperatorSection <$> parseInfixExpr <* indented <*> (Right <$> parseValueAtom)
371+ left = flip OperatorSection <$> (Left <$> parseValueAtom) <* indented <*> parseInfixExpr
372372
373373parsePropertyUpdate :: TokenParser (String , Maybe Expr )
374374parsePropertyUpdate = do
@@ -419,7 +419,7 @@ parseValue = withSourceSpan PositionedValue
419419 ]
420420 operators = [ [ P. Prefix (P. try (C. indented *> symbol' " -" ) >> return UnaryMinus )
421421 ]
422- , [ P. Infix (P. try (C. indented *> parseIdentInfix P. <?> " operator " ) >>= \ ident ->
422+ , [ P. Infix (P. try (C. indented *> parseInfixExpr P. <?> " infix expression " ) >>= \ ident ->
423423 return (BinaryNoParens ident)) P. AssocRight
424424 ]
425425 ]
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ literals = mkPattern' match
7373 , withIndent $ prettyPrintMany prettyPrintDoNotationElement els
7474 , currentIndent
7575 ]
76- match (OperatorSection op (Right val)) = return $ " (" ++ show op ++ " " ++ prettyPrintValue val ++ " )"
77- match (OperatorSection op (Left val)) = return $ " (" ++ prettyPrintValue val ++ " " ++ show op ++ " )"
76+ match (OperatorSection op (Right val)) = return $ " (" ++ prettyPrintValue op ++ " " ++ prettyPrintValue val ++ " )"
77+ match (OperatorSection op (Left val)) = return $ " (" ++ prettyPrintValue val ++ " " ++ prettyPrintValue op ++ " )"
7878 match (TypeClassDictionary name _ _) = return $ " <<dict " ++ show name ++ " >>"
7979 match (SuperClassDictionary name _) = return $ " <<superclass dict " ++ show name ++ " >>"
8080 match (TypedValue _ val _) = prettyPrintValue' val
You can’t perform that action at this time.
0 commit comments