From 96b767d7cab6c8ca41f656e41dd57196cb45e233 Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Mon, 19 May 2025 01:57:15 +0200 Subject: Expression AST and parser Deleted old AST.hs; old code shall re-appear. --- src/Control/Monad/Combinators/FailExpr.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Control/Monad/Combinators/FailExpr.hs') diff --git a/src/Control/Monad/Combinators/FailExpr.hs b/src/Control/Monad/Combinators/FailExpr.hs index 045bd00..0b4b063 100644 --- a/src/Control/Monad/Combinators/FailExpr.hs +++ b/src/Control/Monad/Combinators/FailExpr.hs @@ -20,6 +20,16 @@ where -- Notes: -- * We can merge any operators of the same precedence and associativity. -- (TODO?) +-- * CONSIDER: Support unary (prefix) operators. +-- - Not deemed too useful, because we believe that unary (prefix) +-- operators should always have highest precedence. +-- - Consider the common boolean `!`. +-- - One might want to parse `! 3 == 3` as `! (3 == 3)`, which would +-- require `!` to have a specific precedence (lower than `==`). +-- - However, `! true == true`, should certainly be parsed as +-- `(! true) == true`. +-- - We currently do not support different precedence based on the +-- operands' types, and that seems generally difficult. import Prelude hiding (exp) -- cgit v1.2.3