@@ -25,7 +25,7 @@ p_valDecl = line . p_valDecl'
2525
2626p_valDecl' :: HsBindLR GhcPs GhcPs -> R ()
2727p_valDecl' = \case
28− FunBind funId funMatches _ _ _ -> p_funBind funId funMatches
28+ FunBind NoExt funId funMatches _ _ -> p_funBind funId funMatches
2929 _ -> notImplemented "certain kinds of binding declarations"
3030
3131p_funBind
@@ -48,6 +48,7 @@ p_matchGroup
4848p_matchGroup style MG {..} =
4949 locatedVia Nothing mg_alts $
5050 newlineSep (located' (p_match style))
51+p_matchGroup _ (XMatchGroup NoExt) = notImplemented "XMatchGroup"
5152
5253p_match
5354 :: MatchGroupStyle
@@ -97,13 +98,14 @@ p_match style Match {..} = do
9798 Lambda -> return ()
9899 _ -> breakpoint
99100 newlineSep (located' p_grhs) grhssGRHSs
100− unless (GHC.isEmptyLocalBinds (unL grhssLocalBinds)) $ do
101+ unless (GHC.isEmptyLocalBindsPR (unL grhssLocalBinds)) $ do
101102 newline
102103 line (txt "where")
103104 inci (located grhssLocalBinds p_hsLocalBinds)
105+p_match _ (XMatch NoExt) = notImplemented "XMatchGroup"
104106
105107p_grhs :: GRHS GhcPs (LHsExpr GhcPs) -> R ()
106−p_grhs (GRHS guards body) =
108+p_grhs (GRHS NoExt guards body) =
107109 case guards of
108110 [] -> p_body
109111 xs -> do
@@ -114,21 +116,23 @@ p_grhs (GRHS guards body) =
114116 inci p_body
115117 where
116118 p_body = located body p_hsExpr
119+p_grhs (XGRHS NoExt) = notImplemented "XGRHS"
117120
118121p_stmt :: Stmt GhcPs (LHsExpr GhcPs) -> R ()
119122p_stmt = \case
120123 LastStmt {} -> notImplemented "do notation"
121124 BindStmt {} -> notImplemented "do notation"
122125 ApplicativeStmt {} -> notImplemented "applicative stmt"
123− BodyStmt body _ _ _ -> located body p_hsExpr
124− LetStmt binds -> located binds p_hsLocalBinds
126+ BodyStmt NoExt body _ _ -> located body p_hsExpr
127+ LetStmt NoExt binds -> located binds p_hsLocalBinds
125128 ParStmt {} -> notImplemented "ParStmt"
126129 TransStmt {} -> notImplemented "TransStmt"
127130 RecStmt {} -> notImplemented "RecStmt"
131+ XStmtLR {} -> notImplemented "XStmtLR"
128132
129133p_hsLocalBinds :: HsLocalBindsLR GhcPs GhcPs -> R ()
130134p_hsLocalBinds = \case
131− HsValBinds (ValBindsIn bag lsigs) -> do
135+ HsValBinds NoExt (ValBinds NoExt bag lsigs) -> do
132136 let ssStart = either
133137 (srcSpanStart . getSpan)
134138 (srcSpanStart . getSpan)
@@ -137,62 +141,63 @@ p_hsLocalBinds = \case
137141 p_item (Left x) = located x p_valDecl'
138142 p_item (Right x) = located x p_sigDecl'
139143 newlineSep p_item (sortOn ssStart items)
140− HsValBinds _ -> notImplemented "HsValBinds"
141− HsIPBinds _ -> notImplemented "HsIPBinds"
142− EmptyLocalBinds -> return ()
144+ HsValBinds NoExt _ -> notImplemented "HsValBinds"
145+ HsIPBinds NoExt _ -> notImplemented "HsIPBinds"
146+ EmptyLocalBinds NoExt -> return ()
147+ XHsLocalBindsLR _ -> notImplemented "XHsLocalBindsLR"
143148
144149p_hsExpr :: HsExpr GhcPs -> R ()
145150p_hsExpr = \case
146− HsVar name -> located name p_rdrName'
147− HsUnboundVar _ -> notImplemented "HsUnboundVar"
148− HsConLikeOut _ -> notImplemented "HsConLikeOut"
149− HsRecFld x ->
151+ HsVar NoExt name -> located name p_rdrName'
152+ HsUnboundVar NoExt _ -> notImplemented "HsUnboundVar"
153+ HsConLikeOut NoExt _ -> notImplemented "HsConLikeOut"
154+ HsRecFld NoExt x ->
150155 case x of
151− Unambiguous name _ -> located name p_rdrName'
152− Ambiguous name _ -> located name p_rdrName'
153− HsOverLabel _ _ -> notImplemented "HsOverLabel"
154− HsIPVar (HsIPName name) -> atom name
155− HsOverLit v -> atom (ol_val v)
156− HsLit lit -> atom lit
157− HsLam mgroup ->
156+ Unambiguous NoExt name -> located name p_rdrName'
157+ Ambiguous NoExt name -> located name p_rdrName'
158+ XAmbiguousFieldOcc NoExt -> notImplemented "XAmbiguousFieldOcc"
159+ HsOverLabel NoExt _ _ -> notImplemented "HsOverLabel"
160+ HsIPVar NoExt (HsIPName name) -> atom name
161+ HsOverLit NoExt v -> atom (ol_val v)
162+ HsLit NoExt lit -> atom lit
163+ HsLam NoExt mgroup ->
158164 p_matchGroup Lambda mgroup
159− HsLamCase mgroup -> do
165+ HsLamCase NoExt mgroup -> do
160166 txt "\\case"
161167 newline
162168 inci (p_matchGroup LambdaCase mgroup)
163− HsApp f x -> do
169+ HsApp NoExt f x -> do
164170 located f p_hsExpr
165171 breakpoint
166172 inci (located x p_hsExpr)
167173 HsAppType a e -> do
168− located a p_hsExpr
174+ located e p_hsExpr
169175 breakpoint
170176 inci $ do
171177 txt "@"
172− located (hswc_body e) p_hsType
173− HsAppTypeOut {} -> notImplemented "HsAppTypeOut"
174− OpApp x op _ y -> do
178+ located (hswc_body a) p_hsType
179+ OpApp NoExt x op y -> do
175180 located x p_hsExpr
176181 breakpoint
177182 inci $ do
178183 located op p_hsExpr
179184 space
180185 located y p_hsExpr
181− NegApp e _ -> do
186+ NegApp NoExt e _ -> do
182187 txt "-"
183188 located e p_hsExpr
184− HsPar e -> parens (located e p_hsExpr)
189+ HsPar NoExt e -> parens (located e p_hsExpr)
185190 SectionL {} -> notImplemented "SectionL"
186191 SectionR {} -> notImplemented "SectionR"
187192 ExplicitTuple {} -> notImplemented "ExplicitTuple"
188193 ExplicitSum {} -> notImplemented "ExplicitSum"
189− HsCase e mgroup -> do
194+ HsCase NoExt e mgroup -> do
190195 txt "case "
191196 located e p_hsExpr
192197 txt " of"
193198 breakpoint
194199 inci (p_matchGroup Case mgroup)
195− HsIf _ if' then' else' -> do
200+ HsIf NoExt _ if' then' else' -> do
196201 txt "if "
197202 located if' p_hsExpr
198203 breakpoint
@@ -206,7 +211,7 @@ p_hsExpr = \case
206211 breakpoint
207212 inci (p_hsExpr x)
208213 HsMultiIf {} -> notImplemented "MulitiIf"
209− HsLet localBinds e -> do
214+ HsLet NoExt localBinds e -> do
210215 txt "let "
211216 sitcc (located localBinds p_hsLocalBinds)
212217 breakpoint
@@ -215,13 +220,10 @@ p_hsExpr = \case
215220 HsDo {} -> notImplemented "HsDo"
216221 ExplicitList _ _ xs -> do
217222 brackets $ velt (withSep comma (located' p_hsExpr) xs)
218− ExplicitPArr {} -> notImplemented "ExplicitPArr"
219223 RecordCon {} -> notImplemented "RecordCon"
220224 RecordUpd {} -> notImplemented "RecordUpd"
221225 ExprWithTySig {} -> notImplemented "ExprWithTySig"
222− ExprWithTySigOut {} -> notImplemented "ExprWithTySigOut"
223226 ArithSeq {} -> notImplemented "ArithSeq"
224− PArrSeq {} -> notImplemented "PArrSeq"
225227 HsSCC {} -> notImplemented "HsSCC"
226228 HsCoreAnn {} -> notImplemented "HsCoreAnn"
227229 HsBracket {} -> notImplemented "HsBracket"
@@ -238,14 +240,16 @@ p_hsExpr = \case
238240 HsTick {} -> notImplemented "HsTick"
239241 HsBinTick {} -> notImplemented "HsBinTick"
240242 HsTickPragma {} -> notImplemented "HsTickPragma"
241− EWildPat -> notImplemented "EWildPat"
243+ EWildPat NoExt -> notImplemented "EWildPat"
242244 EAsPat {} -> notImplemented "EAsPat"
243245 EViewPat {} -> notImplemented "EViewPat"
244246 ELazyPat {} -> notImplemented "ELazyPat"
245247 HsWrap {} -> notImplemented "HsWrap"
248+ XExpr {} -> notImplemented "XExpr"
246249
247250----------------------------------------------------------------------------
248251-- Helpers
249252
250253getGRHSSpan :: GRHS GhcPs (LHsExpr GhcPs) -> SrcSpan
251−getGRHSSpan (GRHS _ body) = getSpan body
254+getGRHSSpan (GRHS NoExt _ body) = getSpan body
255+getGRHSSpan (XGRHS NoExt) = notImplemented "XGRHS"