diff options
Diffstat (limited to 'compiler/GHC/Parser/Annotation.hs')
-rw-r--r-- | compiler/GHC/Parser/Annotation.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/GHC/Parser/Annotation.hs b/compiler/GHC/Parser/Annotation.hs index a914a14b71..b414e70be5 100644 --- a/compiler/GHC/Parser/Annotation.hs +++ b/compiler/GHC/Parser/Annotation.hs @@ -14,6 +14,7 @@ module GHC.Parser.Annotation ( -- * In-tree Exact Print Annotations AddEpAnn(..), EpaLocation(..), epaLocationRealSrcSpan, epaLocationFromSrcAnn, + TokenLocation(..), DeltaPos(..), deltaPos, getDeltaLine, EpAnn(..), Anchor(..), AnchorOperation(..), @@ -405,6 +406,11 @@ data EpaLocation = EpaSpan RealSrcSpan | EpaDelta DeltaPos deriving (Data,Show,Eq,Ord) +-- | Tokens embedded in the AST have an EpaLocation, unless they come from +-- generated code (e.g. by TH). +data TokenLocation = NoTokenLoc | TokenLoc !EpaLocation + deriving (Data,Show,Eq,Ord) + -- | Spacing between output items when exact printing. It captures -- the spacing from the current print position on the page to the -- position required for the thing about to be printed. This is |