purescript-contrib/purescript-parsing

Fix issues caused by making `<|>` infixr

JordanMartinez opened this issue · 1 comments

Fix issues caused by making <|> right associative

[1/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Expr.purs:58:5

  58      <?> "operator"
          ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[2/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:442:45

  442    characterChar = charLetter <|> charEscape <?> "literal character"
                                                   ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[3/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:840:58

  840        skipMany (simpleSpace <|> multiLineComment langDef <?> "")
                                                                ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[4/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:867:5

  867      <?> "end of comment"
           ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

[5/8 MixedAssociativityError] .spago/parsing/main/src/Text/Parsing/Parser/Token.purs:877:5

  877      <?> "end of comment"
           ^^^
  
  Cannot parse an expression that uses operators of the same precedence but mixed associativity:
  
    Text.Parsing.Parser.Combinators.(<?>) is infixl
    Control.Alt.(<|>) is infixr
  
  Use parentheses to resolve this ambiguity.

The precedence of this operator is really odd, I think it should probably be at level 2.