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