summaryrefslogtreecommitdiff
path: root/compiler/deSugar/Check.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-01-15 13:11:21 -0600
committerAustin Seipp <austin@well-typed.com>2015-01-16 10:16:05 -0600
commit11881ec6f8d4db881671173441df87c2457409f4 (patch)
treea03777d178fc04dea082e7b12f2c7cf2dfa97ff3 /compiler/deSugar/Check.hs
parentfffbf0627c2c2ee4bc49f9d26a226b39a066945e (diff)
downloadhaskell-11881ec6f8d4db881671173441df87c2457409f4.tar.gz
API Annotations tweaks.
Summary: HsTyLit now has SourceText Update documentation of HsSyn to reflect which annotations are attached to which element. Ensure that the parser always keeps HsSCC and HsTickPragma values, to be ignored in the desugar phase if not needed Bringing in SourceText for pragmas Add Location in NPlusKPat Add Location in FunDep Make RecCon payload Located Explicitly add AnnVal to RdrName where it is compound Add Location in IPBind Add Location to name in IEThingAbs Add Maybe (Located id,Bool) to Match to track fun_id,infix This includes converting Match into a record and adding a note about why the fun_id needs to be replicated in the Match. Add Location in KindedTyVar Sort out semi-colons for parsing - import statements - stmts - decls - decls_cls - decls_inst This updates the haddock submodule. Test Plan: ./validate Reviewers: hvr, austin, goldfire, simonpj Reviewed By: simonpj Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D538
Diffstat (limited to 'compiler/deSugar/Check.hs')
-rw-r--r--compiler/deSugar/Check.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index 7284db3bc8..3d53e698d8 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -452,11 +452,11 @@ get_lit :: Pat id -> Maybe HsLit
-- It doesn't matter which one, because they will only be compared
-- with other HsLits gotten in the same way
get_lit (LitPat lit) = Just lit
-get_lit (NPat (OverLit { ol_val = HsIntegral src i}) mb _)
+get_lit (NPat (L _ (OverLit { ol_val = HsIntegral src i})) mb _)
= Just (HsIntPrim src (mb_neg negate mb i))
-get_lit (NPat (OverLit { ol_val = HsFractional f }) mb _)
+get_lit (NPat (L _ (OverLit { ol_val = HsFractional f })) mb _)
= Just (HsFloatPrim (mb_neg negateFractionalLit mb f))
-get_lit (NPat (OverLit { ol_val = HsIsString src s }) _ _)
+get_lit (NPat (L _ (OverLit { ol_val = HsIsString src s })) _ _)
= Just (HsStringPrim src (fastStringToByteString s))
get_lit _ = Nothing
@@ -727,7 +727,7 @@ tidy_pat (TuplePat ps boxity tys)
where
arity = length ps
-tidy_pat (NPat lit mb_neg eq) = tidyNPat tidy_lit_pat lit mb_neg eq
+tidy_pat (NPat (L _ lit) mb_neg eq) = tidyNPat tidy_lit_pat lit mb_neg eq
tidy_pat (LitPat lit) = tidy_lit_pat lit
tidy_pat (ConPatIn {}) = panic "Check.tidy_pat: ConPatIn"