@@ -339,6 +339,8 @@ pSimpleExtExpr syn = do i <- getState
339339 pExtensions syn (filter simple (syntax_rules i))
340340 where
341341 simple (Rule (Expr x:xs) _ _) = False
342+ simple (Rule [Keyword _] _ _) = True
343+ simple (Rule [Symbol _] _ _) = True
342344 simple (Rule (_:xs) _ _) = case (last xs) of
343345 Keyword _ -> True
344346 Symbol _ -> True
@@ -387,6 +389,7 @@ pExt syn (Rule (s:ssym) ptm _)
387389 update ns (PApp fc t args) = PApp fc (update ns t) (map (fmap (update ns)) args)
388390 update ns (PPair fc l r) = PPair fc (update ns l) (update ns r)
389391 update ns (PDPair fc l t r) = PDPair fc (update ns l) (update ns t) (update ns r)
392+ update ns (PAlternative as) = PAlternative (map (update ns) as)
390393 update ns (PHidden t) = PHidden (update ns t)
391394 update ns (PDoBlock ds) = PDoBlock $ upd ns ds
392395 where upd ns (DoExp fc t : ds) = DoExp fc (update ns t) : upd ns ds
@@ -421,6 +424,7 @@ pSimpleExpr syn =
421424 return (PTactics ts)
422425 <|> try (do x <- pfName; fc <- pfc; return (PRef fc x))
423426 <|> try (pPair syn)
427+ <|> try (pAlt syn)
424428 <|> try (do lchar '('; e <- pExpr syn; lchar ')'; return e)
425429 <|> try (do c <- pConstant; fc <- pfc
426430 return (modifyConst syn fc (PConstant c)))
@@ -448,7 +452,11 @@ pPair syn = try (do lchar '('; l <- pExpr syn; op <- pairOp
448452 where
449453 pairOp = do lchar ','; return PPair
450454 <|> do reservedOp "**"; return (\f x y -> PDPair f x Placeholder y)
451−
455+
456+pAlt syn = do symbol "(|";
457+ alts <- sepBy1 (pExpr' syn) (lchar ',')
458+ symbol "|)"
459+ return (PAlternative alts)
452460
453461pHSimpleExpr syn
454462 = do lchar '.'
@@ -792,6 +800,7 @@ expandDo dsl (PApp fc t args) = PApp fc (expandDo dsl t)
792800expandDo dsl (PPair fc l r) = PPair fc (expandDo dsl l) (expandDo dsl r)
793801expandDo dsl (PDPair fc l t r) = PDPair fc (expandDo dsl l) (expandDo dsl t)
794802 (expandDo dsl r)
803+expandDo dsl (PAlternative as) = PAlternative (map (expandDo dsl) as)
795804expandDo dsl (PHidden t) = PHidden (expandDo dsl t)
796805expandDo dsl (PReturn fc) = PRef fc (dsl_return dsl)
797806expandDo dsl (PDoBlock ds) = expandDo dsl $ block (dsl_bind dsl) ds