mirror of
https://github.com/google/ormolu.git
synced 2024-11-27 13:13:23 +03:00
Workaround pattern constructs in expressions
This commit is contained in:
parent
a2af1eb831
commit
4ae8025f90
@ -13,3 +13,6 @@ multiline
|
|||||||
bar
|
bar
|
||||||
baz
|
baz
|
||||||
) = True
|
) = True
|
||||||
|
|
||||||
|
-- https://github.com/tweag/ormolu/issues/343
|
||||||
|
foo = (f -> 4)
|
||||||
|
@ -10,3 +10,6 @@ g ((f, _), f -> 4) = True
|
|||||||
multiline (t -> Foo
|
multiline (t -> Foo
|
||||||
bar
|
bar
|
||||||
baz) = True
|
baz) = True
|
||||||
|
|
||||||
|
-- https://github.com/tweag/ormolu/issues/343
|
||||||
|
foo = (f -> 4)
|
||||||
|
@ -705,10 +705,22 @@ p_hsExpr = \case
|
|||||||
HsTick {} -> notImplemented "HsTick"
|
HsTick {} -> notImplemented "HsTick"
|
||||||
HsBinTick {} -> notImplemented "HsBinTick"
|
HsBinTick {} -> notImplemented "HsBinTick"
|
||||||
HsTickPragma {} -> notImplemented "HsTickPragma"
|
HsTickPragma {} -> notImplemented "HsTickPragma"
|
||||||
|
-- These four constructs should never appear in correct programs.
|
||||||
|
-- See: https://github.com/tweag/ormolu/issues/343
|
||||||
EWildPat NoExt -> txt "_"
|
EWildPat NoExt -> txt "_"
|
||||||
EAsPat {} -> notImplemented "EAsPat"
|
EAsPat NoExt n p -> do
|
||||||
EViewPat {} -> notImplemented "EViewPat"
|
p_rdrName n
|
||||||
ELazyPat {} -> notImplemented "ELazyPat"
|
txt "@"
|
||||||
|
located p p_hsExpr
|
||||||
|
EViewPat NoExt p e -> do
|
||||||
|
located p p_hsExpr
|
||||||
|
space
|
||||||
|
txt "->"
|
||||||
|
breakpoint
|
||||||
|
inci (located e p_hsExpr)
|
||||||
|
ELazyPat NoExt p -> do
|
||||||
|
txt "~"
|
||||||
|
located p p_hsExpr
|
||||||
HsWrap {} -> notImplemented "HsWrap"
|
HsWrap {} -> notImplemented "HsWrap"
|
||||||
XExpr {} -> notImplemented "XExpr"
|
XExpr {} -> notImplemented "XExpr"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user