-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module HIndent.Ast.Declaration.Instance.Class.OverlapMode | ||
( OverlapMode | ||
, mkOverlapMode | ||
) where | ||
|
||
import qualified GHC.Types.Basic as GHC | ||
import HIndent.Ast.NodeComments | ||
import {-# SOURCE #-} HIndent.Pretty | ||
import HIndent.Pretty.Combinators.String | ||
import HIndent.Pretty.NodeComments | ||
|
||
data OverlapMode | ||
= Overlappable | ||
| Overlapping | ||
| Overlaps | ||
| Incoherent | ||
|
||
instance CommentExtraction OverlapMode where | ||
nodeComments Overlappable = NodeComments [] [] [] | ||
nodeComments Overlapping = NodeComments [] [] [] | ||
nodeComments Overlaps = NodeComments [] [] [] | ||
nodeComments Incoherent = NodeComments [] [] [] | ||
|
||
instance Pretty OverlapMode where | ||
pretty' Overlappable = string "{-# OVERLAPPABLE #-}" | ||
pretty' Overlapping = string "{-# OVERLAPPING #-}" | ||
pretty' Overlaps = string "{-# OVERLAPS #-}" | ||
pretty' Incoherent = string "{-# INCOHERENT #-}" | ||
|
||
mkOverlapMode :: GHC.OverlapMode -> OverlapMode | ||
mkOverlapMode GHC.NoOverlap {} = | ||
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (ubuntu-latest, 9.8.1)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (ubuntu-latest, 9.6.4)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (ubuntu-latest, 9.4.8)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (windows-latest, 9.4.8)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (windows-latest, 9.8.1)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (windows-latest, nightly)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (windows-latest, nightly)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (macos-13, 9.4.8)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (windows-latest, 9.6.4)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (macos-13, 9.8.1)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (macos-13, 9.6.4)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (macos-latest, nightly)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (macos-latest, nightly)
Check warning on line 31 in src/HIndent/Ast/Declaration/Instance/Class/OverlapMode.hs GitHub Actions / CI (ubuntu-latest, nightly)
|
||
error "This AST node should never appear in the tree" | ||
mkOverlapMode GHC.Overlappable {} = Overlappable | ||
mkOverlapMode GHC.Overlapping {} = Overlapping | ||
mkOverlapMode GHC.Overlaps {} = Overlaps | ||
mkOverlapMode GHC.Incoherent {} = Incoherent |