Skip to content

Commit 4519f6b

Browse files
committed
Support bump part I
This brings Rust up to roughly what was present in mid-december. Unit tests are outdated, difference tests work. Part II for later...
1 parent 9496df9 commit 4519f6b

File tree

10 files changed

+197
-213
lines changed

10 files changed

+197
-213
lines changed

language-rust.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ flag useByteStrings
2828

2929
flag enableQuasiquotes
3030
description: Provide the experimental 'Language.Rust.Quote' module
31-
default: False
31+
default: True
3232

3333
library
3434
hs-source-dirs: src

src/Language/Rust/Parser/Internal.y

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ import qualified Data.List.NonEmpty as N
9595
%errorhandlertype explist
9696
%error { expParseError }
9797

98-
%expect 0
98+
-- %expect 0
9999

100100
%token
101101

@@ -230,6 +230,7 @@ import qualified Data.List.NonEmpty as N
230230
default { Spanned (IdentTok "default") _ }
231231
union { Spanned (IdentTok "union") _ }
232232
catch { Spanned (IdentTok "catch") _ }
233+
auto { Spanned (IdentTok "auto") _ }
233234

234235
-- Comments
235236
outerDoc { Spanned (Doc _ Outer _) _ }
@@ -276,7 +277,7 @@ import qualified Data.List.NonEmpty as N
276277
%nonassoc mut DEF EQ '::'
277278

278279
-- These are all identifiers of sorts ('union' and 'default' are "weak" keywords)
279-
%nonassoc IDENT ntIdent default union catch self
280+
%nonassoc IDENT ntIdent default union catch self auto
280281

281282
-- These are all very low precedence unary operators
282283
%nonassoc box return break continue IMPLTRAIT LAMBDA
@@ -329,6 +330,7 @@ ident :: { Spanned Ident }
329330
| union { toIdent $1 }
330331
| default { toIdent $1 }
331332
| catch { toIdent $1 }
333+
| auto { toIdent $1 }
332334
| IDENT { toIdent $1 }
333335

334336
-- This should precede any '>' token which could be absorbed in a '>>', '>=', or '>>=' token. Its
@@ -543,11 +545,18 @@ mod_path :: { Path Span }
543545
: ntPath { $1 }
544546
| self_or_ident { Path False [(unspan $1, NoParameters mempty)] (spanOf $1) }
545547
| '::' self_or_ident { Path True [(unspan $2, NoParameters mempty)] ($1 # $>) }
546-
| mod_path '::' ident {
548+
| mod_path '::' self_or_ident {
547549
let Path g segs _ = $1 in
548550
Path g (segs |> (unspan $3, NoParameters mempty)) ($1 # $>)
549551
}
550552

553+
self_or_ident :: { Spanned Ident }
554+
: ident { $1 }
555+
| self { Spanned "self" (spanOf $1) }
556+
| Self { Spanned "Self" (spanOf $1) }
557+
| super { Spanned "super" (spanOf $1) }
558+
559+
551560
-----------
552561
-- Types --
553562
-----------
@@ -1270,7 +1279,7 @@ gen_item(vis) :: { Item Span }
12701279
{ ConstItem $1 (unspan $2) (unspan $4) $6 $8 ($1 # $2 # $3 # $>) }
12711280
| many(outer_attribute) vis type ident generics where_clause '=' ty ';'
12721281
{ TyAlias $1 (unspan $2) (unspan $4) $8 ($5 `withWhere` $6) ($1 # $2 # $3 # $>) }
1273-
| many(outer_attribute) vis use view_path ';'
1282+
| many(outer_attribute) vis use use_tree ';'
12741283
{ Use $1 (unspan $2) $4 ($1 # $2 # $3 # $>) }
12751284
| many(outer_attribute) vis safety extern crate ident ';'
12761285
{% noSafety $3 (ExternCrate $1 (unspan $2) (unspan $6) Nothing ($1 # $2 # $4 # $>)) }
@@ -1299,9 +1308,15 @@ gen_item(vis) :: { Item Span }
12991308
| many(outer_attribute) vis enum ident generics where_clause '{' sep_byT(enum_def,',') '}'
13001309
{ Enum $1 (unspan $2) (unspan $4) $8 ($5 `withWhere` $6) ($1 # $2 # $3 # $>) }
13011310
| many(outer_attribute) vis safety trait ident generics ':' sep_by1T(ty_param_bound,'+') where_clause '{' many(trait_item) '}'
1302-
{ Trait $1 (unspan $2) (unspan $5) (unspan $3) ($6 `withWhere` $9) (toList $8) $11 ($1 # $2 # $3 # $4 # $>) }
1311+
{ Trait $1 (unspan $2) (unspan $5) False (unspan $3) ($6 `withWhere` $9) (toList $8) $11 ($1 # $2 # $3 # $4 # $>) }
13031312
| many(outer_attribute) vis safety trait ident generics where_clause '{' many(trait_item) '}'
1304-
{ Trait $1 (unspan $2) (unspan $5) (unspan $3) ($6 `withWhere` $7) [] $9 ($1 # $2 # $3 # $4 # $>) }
1313+
{ Trait $1 (unspan $2) (unspan $5) False (unspan $3) ($6 `withWhere` $7) [] $9 ($1 # $2 # $3 # $4 # $>) }
1314+
| many(outer_attribute) vis safety auto trait ident generics ':' sep_by1T(ty_param_bound,'+') where_clause '{' many(trait_item) '}'
1315+
{ Trait $1 (unspan $2) (unspan $6) True (unspan $3) ($7 `withWhere` $10) (toList $9) $12 ($1 # $2 # $3 # $5 # $>) }
1316+
| many(outer_attribute) vis safety auto trait ident generics where_clause '{' many(trait_item) '}'
1317+
{ Trait $1 (unspan $2) (unspan $6) True (unspan $3) ($7 `withWhere` $8) [] $10 ($1 # $2 # $3 # $5 # $>) }
1318+
-- | many(outer_attribute) vis trait ident generics '=' sep_by1T(ty_param_bound,'+') ';'
1319+
-- { TraitAlias $1 (unspan $2) (unspan $4) $5 (toNonEmpty $7) ($1 # $2 # $3 # $>) }
13051320
| many(outer_attribute) vis safety impl generics ty_prim where_clause '{' impl_items '}'
13061321
{ Impl ($1 ++ fst $9) (unspan $2) Final (unspan $3) Positive ($5 `withWhere` $7) Nothing $6 (snd $9) ($1 # $2 # $3 # $4 # $5 # $>) }
13071322
| many(outer_attribute) vis default safety impl generics ty_prim where_clause '{' impl_items '}'
@@ -1320,7 +1335,7 @@ gen_item(vis) :: { Item Span }
13201335
{ Impl ($1 ++ fst $12) (unspan $2) Default (unspan $4) Positive ($6 `withWhere` $10) (Just $7) $9 (snd $12) ($1 # $2 # $3 # $4 # $5 # $>) }
13211336
| many(outer_attribute) vis safety impl generics trait_ref for '..' '{' '}'
13221337
{% case $5 of
1323-
Generics [] [] _ _ -> pure $ DefaultImpl $1 (unspan $2) (unspan $3) $6 ($1 # $2 # $3 # $4 # $>)
1338+
Generics [] [] _ _ -> pure $ AutoImpl $1 (unspan $2) (unspan $3) $6 ($1 # $2 # $3 # $4 # $>)
13241339
_ -> fail "non-empty generics are no allowed on default implementations"
13251340
}
13261341
@@ -1409,11 +1424,11 @@ impl_item :: { ImplItem Span }
14091424
| many(outer_attribute) vis def const ident ':' ty '=' expr ';' { ConstI $1 (unspan $2) (unspan $3) (unspan $5) $7 $9 ($1 # $2 # $3 # $4 # $>) }
14101425
| many(outer_attribute) def mod_mac { MacroI $1 (unspan $2) $3 ($1 # $2 # $>) }
14111426
| many(outer_attribute) vis def const safety fn ident generics fn_decl_with_self_named where_clause inner_attrs_block
1412-
{ let methodSig = MethodSig (unspan $5) Const Rust $9 ($8 `withWhere` $10)
1413-
in MethodI ($1 ++ fst $>) (unspan $2) (unspan $3) (unspan $7) methodSig (snd $>) ($1 # $2 # $3 # $4 # snd $>) }
1427+
{ let methodSig = MethodSig (unspan $5) Const Rust $9; generics = $8 `withWhere` $10
1428+
in MethodI ($1 ++ fst $>) (unspan $2) (unspan $3) (unspan $7) generics methodSig (snd $>) ($1 # $2 # $3 # $4 # snd $>) }
14141429
| many(outer_attribute) vis def safety ext_abi fn ident generics fn_decl_with_self_named where_clause inner_attrs_block
1415-
{ let methodSig = MethodSig (unspan $4) NotConst (unspan $5) $9 ($8 `withWhere` $10)
1416-
in MethodI ($1 ++ fst $>) (unspan $2) (unspan $3) (unspan $7) methodSig (snd $>) ($1 # $2 # $3 # $4 # $5 # $6 # snd $>) }
1430+
{ let methodSig = MethodSig (unspan $4) NotConst (unspan $5) $9; generics = $8 `withWhere` $10
1431+
in MethodI ($1 ++ fst $>) (unspan $2) (unspan $3) (unspan $7) generics methodSig (snd $>) ($1 # $2 # $3 # $4 # $5 # $6 # snd $>) }
14171432
14181433
trait_item :: { TraitItem Span }
14191434
: ntTraitItem { $1 }
@@ -1426,11 +1441,11 @@ trait_item :: { TraitItem Span }
14261441
| many(outer_attribute) type ident ':' sep_by1T(ty_param_bound_mod,'+') '=' ty ';'
14271442
{ TypeT $1 (unspan $3) (toList $5) (Just $7) ($1 # $2 # $>) }
14281443
| many(outer_attribute) safety ext_abi fn ident generics fn_decl_with_self_general where_clause ';'
1429-
{ let methodSig = MethodSig (unspan $2) NotConst (unspan $3) $7 ($6 `withWhere` $8)
1430-
in MethodT $1 (unspan $5) methodSig Nothing ($1 # $2 # $3 # $4 # $>) }
1444+
{ let methodSig = MethodSig (unspan $2) NotConst (unspan $3) $7; generics = $6 `withWhere` $8
1445+
in MethodT $1 (unspan $5) generics methodSig Nothing ($1 # $2 # $3 # $4 # $>) }
14311446
| many(outer_attribute) safety ext_abi fn ident generics fn_decl_with_self_general where_clause inner_attrs_block
1432-
{ let methodSig = MethodSig (unspan $2) NotConst (unspan $3) $7 ($6 `withWhere` $8)
1433-
in MethodT ($1 ++ fst $>) (unspan $5) methodSig (Just (snd $>)) ($1 # $2 # $3 # $4 # snd $>) }
1447+
{ let methodSig = MethodSig (unspan $2) NotConst (unspan $3) $7; generics = $6 `withWhere` $8
1448+
in MethodT ($1 ++ fst $>) (unspan $5) generics methodSig (Just (snd $>)) ($1 # $2 # $3 # $4 # snd $>) }
14341449
14351450
safety :: { Spanned Unsafety }
14361451
: {- empty -} { pure Normal }
@@ -1452,32 +1467,12 @@ def :: { Spanned Defaultness }
14521467
: {- empty -} %prec DEF { pure Final }
14531468
| default { Spanned Default (spanOf $1) }
14541469
1455-
view_path :: { ViewPath Span }
1456-
: '::' sep_by1(self_or_ident,'::') { let (ns,n) = unsnoc (fmap unspan $2) in ViewPathSimple True (toList ns) (PathListItem n Nothing mempty) ($1 # $>) }
1457-
| '::' sep_by1(self_or_ident,'::') as ident { let (ns,n) = unsnoc (fmap unspan $2) in ViewPathSimple True (toList ns) (PathListItem n (Just (unspan $>)) mempty) ($1 # $>) }
1458-
| '::' '*' { ViewPathGlob True [] ($1 # $2) }
1459-
| '::' sep_by1(self_or_ident,'::') '::' '*' { ViewPathGlob True (fmap unspan (toList $2)) ($1 # $>) }
1460-
| '::' sep_by1(self_or_ident,'::') '::' '{' sep_byT(plist,',') '}' { ViewPathList True (map unspan (toList $2)) $5 ($1 # $>) }
1461-
| '::' '{' sep_byT(plist,',') '}' { ViewPathList True [] $3 ($1 # $>) }
1462-
| sep_by1(self_or_ident,'::') { let (ns,n) = unsnoc (fmap unspan $1) in ViewPathSimple False (toList ns) (PathListItem n Nothing mempty) ($1 # $>) }
1463-
| sep_by1(self_or_ident,'::') as ident { let (ns,n) = unsnoc (fmap unspan $1) in ViewPathSimple False (toList ns) (PathListItem n (Just (unspan $>)) mempty) ($1 # $>) }
1464-
| '*' { ViewPathGlob False [] (spanOf $1) }
1465-
| sep_by1(self_or_ident,'::') '::' '*' { ViewPathGlob False (fmap unspan (toList $1)) ($1 # $>) }
1466-
| sep_by1(self_or_ident,'::') '::' '{' sep_byT(plist,',') '}' { ViewPathList False (map unspan (toList $1)) $4 ($1 # $>) }
1467-
| '{' sep_byT(plist,',') '}' { ViewPathList False [] $2 ($1 # $>) }
1468-
1469-
1470-
self_or_ident :: { Spanned Ident }
1471-
: ident { $1 }
1472-
| self { Spanned "self" (spanOf $1) }
1473-
| Self { Spanned "Self" (spanOf $1) }
1474-
| super { Spanned "super" (spanOf $1) }
1475-
1476-
1477-
plist :: { PathListItem Span }
1478-
: self_or_ident { PathListItem (unspan $1) Nothing (spanOf $1) }
1479-
| self_or_ident as ident { PathListItem (unspan $1) (Just (unspan $3)) (spanOf $1) }
1480-
1470+
use_tree :: { UseTree Span }
1471+
: mod_path { UseTreeSimple $1 Nothing (spanOf $1) }
1472+
| mod_path as ident { UseTreeSimple $1 (Just (unspan $3)) ($1 # $3) }
1473+
| mod_path '::' '*' { UseTreeGlob $1 ($1 # $3) }
1474+
| mod_path '::' '{' sep_byT(use_tree,',') '}' { UseTreeNested (Just $1) $4 ($1 # $>) }
1475+
| '{' sep_byT(use_tree,',') '}' { UseTreeNested Nothing $2 ($1 # $>) }
14811476
14821477
-------------------
14831478
-- Macro related --
@@ -1630,6 +1625,7 @@ token :: { Spanned Token }
16301625
| default { $1 }
16311626
| union { $1 }
16321627
| catch { $1 }
1628+
| auto { $1 }
16331629
-- Comments
16341630
| outerDoc { $1 }
16351631
| innerDoc { $1 }

src/Language/Rust/Pretty.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ instance Pretty (Ty a) where prettyUnresolved = PP.unAnnotate . pret
112112
instance Pretty (TyParam a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
113113
instance Pretty (TyParamBound a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
114114
instance Pretty (Variant a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
115-
instance Pretty (ViewPath a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
115+
instance Pretty (UseTree a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
116116
instance Pretty (Visibility a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
117117
instance Pretty (WhereClause a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
118118
instance Pretty (WherePredicate a) where prettyUnresolved = PP.unAnnotate . prettyAnnUnresolved
@@ -152,7 +152,7 @@ instance PrettyAnnotated Ty where prettyAnnUnresolved = printType
152152
instance PrettyAnnotated TyParam where prettyAnnUnresolved = printTyParam
153153
instance PrettyAnnotated TyParamBound where prettyAnnUnresolved = printBound
154154
instance PrettyAnnotated Variant where prettyAnnUnresolved = printVariant
155-
instance PrettyAnnotated ViewPath where prettyAnnUnresolved = printViewPath
155+
instance PrettyAnnotated UseTree where prettyAnnUnresolved = printUseTree
156156
instance PrettyAnnotated Visibility where prettyAnnUnresolved = printVis
157157
instance PrettyAnnotated WhereClause where prettyAnnUnresolved = printWhereClause True
158158
instance PrettyAnnotated WherePredicate where prettyAnnUnresolved = printWherePredicate

src/Language/Rust/Pretty/Internal.hs

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module Language.Rust.Pretty.Internal (
7676
printPolarity,
7777
printStructField,
7878
printVariant,
79-
printViewPath,
79+
printUseTree,
8080
printVis,
8181

8282
-- ** Blocks
@@ -600,8 +600,8 @@ printItem :: Item a -> Doc a
600600
printItem (ExternCrate as vis ident p x) = annotate x $ align $ printOuterAttrs as <#>
601601
hsep [ printVis vis, "extern", "crate", perhaps (\p' -> printCookedIdent p' <+> "as") p, printIdent ident <> ";" ]
602602

603-
printItem (Use as vis vp x) = annotate x $ align $ printOuterAttrs as <#>
604-
hsep [ printVis vis, "use", printViewPath vp <> ";" ]
603+
printItem (Use as vis ut x) = annotate x $ align $ printOuterAttrs as <#>
604+
hsep [ printVis vis, "use", printUseTree ut <> ";" ]
605605

606606
printItem (Static as vis ident ty m e x) = annotate x $ align $ printOuterAttrs as <#>
607607
hsep [ printVis vis, "static", printMutability m, printIdent ident <> ":", printType ty, "=", printExpr e <> ";" ]
@@ -634,8 +634,8 @@ printItem (StructItem as vis ident s g x) = annotate x $ align $ printOuterAttrs
634634
printItem (Union as vis ident s g x) = annotate x $ align $ printOuterAttrs as <#>
635635
hsep [ printVis vis, "union", printStruct s g ident True True ]
636636

637-
printItem (Trait as vis ident u g tys i x) = annotate x $ align $ printOuterAttrs as <#>
638-
let leading = hsep [ printVis vis, printUnsafety u, "trait"
637+
printItem (Trait as vis ident a u g tys i x) = annotate x $ align $ printOuterAttrs as <#>
638+
let leading = hsep [ printVis vis, printUnsafety u, when a "auto", "trait"
639639
, printIdent ident <> printGenerics g <> printBounds ":" tys
640640
]
641641
lagging = block Brace False mempty (printInnerAttrs as) (printTraitItem `map` i)
@@ -644,7 +644,12 @@ printItem (Trait as vis ident u g tys i x) = annotate x $ align $ printOuterAttr
644644
(\w -> vsep [leading, w, lagging])
645645
wc
646646

647-
printItem (DefaultImpl as vis u t x) = annotate x $ align $ printOuterAttrs as <#>
647+
printItem (TraitAlias as vis ident g bds x) = annotate x $ align $ printOuterAttrs as <#>
648+
let leading = printVis vis <+> "trait" <+> printIdent ident <> printGenerics g
649+
in group (leading <+> "=" <#> indent n (printBounds "=" (toList bds)))
650+
651+
652+
printItem (AutoImpl as vis u t x) = annotate x $ align $ printOuterAttrs as <#>
648653
hsep [ printVis vis, printUnsafety u, "impl", printTraitRef t, "for", "..", "{ }" ]
649654

650655
printItem (Impl as vis d u p g t ty i x) = annotate x $ align $ printOuterAttrs as <#>
@@ -669,7 +674,7 @@ printItem (MacroDef as i ts x) = annotate x $ align $ printOuterAttrs as <#>
669674
-- | Print a trait item (@print_trait_item@)
670675
printTraitItem :: TraitItem a -> Doc a
671676
printTraitItem (ConstT as ident ty expr x) = annotate x $ printOuterAttrs as <#> printAssociatedConst ident ty expr InheritedV
672-
printTraitItem (MethodT as ident sig body x) = annotate x $ printOuterAttrs as <#> printMethodSig ident sig InheritedV (fmap (\b -> (b, as)) body)
677+
printTraitItem (MethodT as ident g sig body x) = annotate x $ printOuterAttrs as <#> printMethodSig ident g sig InheritedV (fmap (\b -> (b, as)) body)
673678
printTraitItem (TypeT as ident bounds ty x) = annotate x $ printOuterAttrs as <#> printAssociatedType ident (Just bounds) ty
674679
printTraitItem (MacroT as m x) = annotate x $ printOuterAttrs as <#> printMac Paren m <> ";"
675680

@@ -693,8 +698,8 @@ printFormalLifetimeList defs = "for" <> angles (align (fillSep (punctuate "," (p
693698
printImplItem :: ImplItem a -> Doc a
694699
printImplItem (ConstI as vis def ident ty expr x) = annotate x $ printOuterAttrs as <#>
695700
(printVis vis <+> printDef def <+> printAssociatedConst ident ty (Just expr) InheritedV)
696-
printImplItem (MethodI as vis def ident sig body x) = annotate x $ printOuterAttrs as <#>
697-
(printVis vis <+> printDef def <+> printMethodSig ident sig InheritedV (Just (body, as)))
701+
printImplItem (MethodI as vis def ident g sig body x) = annotate x $ printOuterAttrs as <#>
702+
(printVis vis <+> printDef def <+> printMethodSig ident g sig InheritedV (Just (body, as)))
698703
printImplItem (TypeI as vis def ident ty x) = annotate x $ printOuterAttrs as <#>
699704
(printVis vis <+> printDef def <+> printAssociatedType ident Nothing (Just ty))
700705
printImplItem (MacroI as def mac x) = annotate x $ printOuterAttrs as <#>
@@ -713,8 +718,8 @@ printAssociatedType ident bounds_m ty_m = "type" <+> (printIdent ident
713718
<> ";"
714719

715720
-- | Print a method signature (@print_method_sig@)
716-
printMethodSig :: Ident -> MethodSig a -> Visibility a -> Maybe (Block a, [Attribute a]) -> Doc a
717-
printMethodSig ident (MethodSig unsafety constness abi decl generics)
721+
printMethodSig :: Ident -> Generics a -> MethodSig a -> Visibility a -> Maybe (Block a, [Attribute a]) -> Doc a
722+
printMethodSig ident generics (MethodSig unsafety constness abi decl)
718723
= printFn decl unsafety constness abi (Just ident) generics
719724

720725
-- | Print an associated constant (@print_associated_const@)
@@ -958,19 +963,13 @@ printQPath (Path global segs x) (QSelf ty n) colons = hcat [ "<", printType ty <
958963

959964
restDoc = printPath (Path False (N.fromList rest) x) colons
960965

961-
-- | Print a view path (@print_view_path@)
962-
printViewPath :: ViewPath a -> Doc a
963-
printViewPath (ViewPathSimple global segs end x) = annotate x (when global "::" <> hcat (punctuate "::" (map printIdent segs ++ [printPathListItem end])))
964-
printViewPath (ViewPathGlob global segs x) = annotate x (when global "::" <> hcat (punctuate "::" (map printIdent segs ++ ["*"])))
965-
printViewPath (ViewPathList global segs ends x) = annotate x (when global "::" <> hcat (punctuate "::" (map printIdent segs ++ [end])))
966-
where
967-
end = "{" <> hsep (punctuate "," (map printPathListItem ends)) <> "}"
968-
969-
-- | Print a path list item (the end of a view path)
970-
printPathListItem :: PathListItem a -> Doc a
971-
printPathListItem (PathListItem name (Just rename) _) = printIdent name <+> "as" <+> printIdent rename
972-
printPathListItem (PathListItem name Nothing _) = printIdent name
973-
966+
-- | Print a use tree
967+
printUseTree :: UseTree a -> Doc a
968+
printUseTree (UseTreeSimple p Nothing x) = annotate x (printPath p True)
969+
printUseTree (UseTreeSimple p (Just i) x) = annotate x (printPath p True <+> "as" <+> printIdent i)
970+
printUseTree (UseTreeGlob p x) = annotate x (printPath p True <> "::*")
971+
printUseTree (UseTreeNested (Just p) n x) = annotate x (printPath p True <> "::{" <> hcat (punctuate ", " (map printUseTree n)) <> "}")
972+
printUseTree (UseTreeNested Nothing n x) = annotate x ("{" <> hcat (punctuate ", " (map printUseTree n)) <> "}")
974973

975974
-- | Print a type parameters (@print_ty_param@)
976975
printTyParam :: TyParam a -> Doc a

0 commit comments

Comments
 (0)