This commit is contained in:
2026-09-11 16:53:07 -06:00
parent 1a93f168a9
commit 8aee7c9a58
+47
View File
@@ -218,6 +218,31 @@ matches ps es = getAp . foldMap Ap $ alignWith f ps es
trans_when :: Trans
trans_when = MkTrans
{ ellipsis = "..."
, keywords = []
, rules =
[ MkRule
(PatList
[ PatVar "when"
, PatVar "test"
, PatVar "body" ]
(Just [])
Nothing)
(TemList
[ El $ TemVar "if"
, El $ TemVar "test"
, El $ TemList
[ El $ TemVar "begin"
, Ellipsis $ TemVar "body"
]
Nothing
]
Nothing)
]
}
trans_and :: Trans trans_and :: Trans
trans_and = MkTrans trans_and = MkTrans
{ ellipsis = "..." { ellipsis = "..."
@@ -229,5 +254,27 @@ trans_and = MkTrans
Nothing Nothing
Nothing) Nothing)
(TemLit (LitBool True)) (TemLit (LitBool True))
, MkRule
(PatList
[PatVar "and", PatVar "x"]
Nothing
Nothing)
(TemVar "x")
, MkRule
(PatList
[PatVar "and", PatVar "x", PatVar "y"]
(Just [])
Nothing)
(TemList
[ El (TemVar "if")
, El (TemVar "x")
, El (TemList
[ El (TemVar "and")
, Ellipsis (TemVar "y")
]
Nothing)
, El . TemLit . LitBool $ False
]
Nothing)
] ]
} }