Turn off unary negation parsing for now. It has weird behavior when

paired with function calls:

  (- sqrt 9)   -- parse error
  (-sqrt 9)    -- type error, cannot negate function
  -(sqrt 9)    -- this works
  - (sqrt 9)   -- parse error
  - sqrt 9     -- parse error
This commit is contained in:
Evan Czaplicki 2013-07-15 12:22:04 +02:00
parent 2b9886336f
commit 90d50dbb13

View file

@ -126,7 +126,7 @@ recordTerm = brackets $ choice [ misc, addLocation record ]
term :: IParser (LExpr t v) term :: IParser (LExpr t v)
term = addLocation (choice [ Literal <$> literal, listTerm, accessor, negative ]) term = addLocation (choice [ Literal <$> literal, listTerm, accessor ])
<|> accessible (addLocation varTerm <|> parensTerm <|> recordTerm) <|> accessible (addLocation varTerm <|> parensTerm <|> recordTerm)
<?> "basic term (4, x, 'c', etc.)" <?> "basic term (4, x, 'c', etc.)"