From: sof Date: Mon, 26 May 1997 02:13:56 +0000 (+0000) Subject: [project @ 1997-05-26 02:13:56 by sof] X-Git-Tag: Approximately_1000_patches_recorded~544 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=abe449ef863b82b48755af33fce788f6d691a89d;p=ghc-hetmet.git [project @ 1997-05-26 02:13:56 by sof] Changed lexing of unfoldings --- diff --git a/ghc/compiler/reader/Lex.lhs b/ghc/compiler/reader/Lex.lhs index 594da4d..f886a52 100644 --- a/ghc/compiler/reader/Lex.lhs +++ b/ghc/compiler/reader/Lex.lhs @@ -26,7 +26,8 @@ IMPORT_DELOOPER(IdLoop) -- get the CostCentre type&constructors from here import CmdLineOpts ( opt_IgnoreIfacePragmas ) import Demand ( Demand(..) {- instance Read -} ) import UniqFM ( UniqFM, listToUFM, lookupUFM) ---import FiniteMap ( FiniteMap, listToFM, lookupFM ) +import BasicTypes ( NewOrData(..) ) + #if __GLASGOW_HASKELL__ >= 202 import Maybes ( MaybeErr(..) ) #else @@ -37,8 +38,7 @@ import Pretty import ErrUtils ( Error(..) ) -import Outputable ( Outputable(..) ) -import PprStyle ( PprStyle(..) ) +import Outputable ( Outputable(..), PprStyle(..) ) import Util ( nOfThem, panic ) import FastString @@ -207,7 +207,8 @@ data IfaceToken | ITtysig [IfaceToken] -- lazily return the stream of tokens for -- the info attached to an id. -- Stuff for reading unfoldings - | ITarity | ITstrict | ITunfold + | ITarity | ITstrict + | ITunfold Bool -- True <=> there's an INLINE pragma on this Id | ITdemand [Demand] | ITbottom | ITlam | ITbiglam | ITcase | ITprim_case | ITlet | ITletrec | ITin | ITof | ITcoerce_in | ITcoerce_out | ITatsign @@ -343,13 +344,15 @@ lex_demand buf = 'P'# -> read_em (WwPrim : acc) (stepOn buf) 'E'# -> read_em (WwEnum : acc) (stepOn buf) ')'# -> (reverse acc, stepOn buf) - 'U'# -> do_unpack True acc (stepOnBy# buf 2#) - 'u'# -> do_unpack False acc (stepOnBy# buf 2#) + 'U'# -> do_unpack DataType True acc (stepOnBy# buf 2#) + 'u'# -> do_unpack DataType False acc (stepOnBy# buf 2#) + 'N'# -> do_unpack NewType True acc (stepOnBy# buf 2#) + 'n'# -> do_unpack NewType False acc (stepOnBy# buf 2#) _ -> (reverse acc, buf) - do_unpack wrapper_unpacks acc buf + do_unpack new_or_data wrapper_unpacks acc buf = case read_em [] buf of - (stuff, rest) -> read_em (WwUnpack wrapper_unpacks stuff : acc) rest + (stuff, rest) -> read_em (WwUnpack new_or_data wrapper_unpacks stuff : acc) rest ------------------ lex_scc buf = @@ -734,7 +737,8 @@ ifaceKeywordsFM = listToUFM $ ,("declarations_", ITdeclarations) ,("pragmas_", ITpragmas) ,("forall_", ITforall) - ,("U_", ITunfold) + ,("U_", ITunfold False) + ,("U!_", ITunfold True) ,("A_", ITarity) ,("coerce_in_", ITcoerce_in) ,("coerce_out_", ITcoerce_out)