alex-meta 0.3.0.8 → 0.3.0.9
raw patch · 3 files changed
+393/−51 lines, 3 filesdep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: template-haskell
API changes (from Hackage documentation)
Files
- alex-meta.cabal +2/−2
- dist/build/Parser.hs +174/−1
- dist/build/Scan.hs +217/−48
alex-meta.cabal view
@@ -1,5 +1,5 @@ Name: alex-meta-Version: 0.3.0.8+Version: 0.3.0.9 Synopsis: Quasi-quoter for Alex lexers -- Description: License: BSD3@@ -23,7 +23,7 @@ -- Packages needed in order to build this package. Build-depends:- template-haskell >=2.5&&<2.11+ template-haskell >=2.5&&<2.12 , haskell-src-meta >=0.5.1.2&&<1.0 , base >= 4.2 && < 5 , array, containers
dist/build/Parser.hs view
@@ -21,8 +21,9 @@ import qualified Data.Array as Happy_Data_Array import qualified GHC.Exts as Happy_GHC_Exts import Control.Applicative(Applicative(..)) +import Control.Monad (ap) --- parser produced by Happy Version 1.19.4 +-- parser produced by Happy Version 1.19.5 newtype HappyAbsSyn = HappyAbsSyn HappyAny #if __GLASGOW_HASKELL__ >= 607 @@ -872,6 +873,178 @@ {-# LINE 1 "templates\\GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-} {-# LINE 1 "<command-line>" #-} +{-# LINE 12 "<command-line>" #-} +{-# LINE 1 "G:\\GitHub\\haskell-platform\\build\\ghc-bindist\\local\\lib/include\\ghcversion.h" #-} + + + + + + + + + + + + + + + + + +{-# LINE 12 "<command-line>" #-} +{-# LINE 1 "C:\\Users\\randy\\AppData\\Local\\Temp\\ghc16932_0\\ghc_2.h" #-} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{-# LINE 12 "<command-line>" #-} {-# LINE 1 "templates\\GenericTemplate.hs" #-} -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp
dist/build/Scan.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-missing-signatures #-} {-# LANGUAGE CPP,MagicHash #-} {-# LINE 13 "src\Scan.x" #-} @@ -16,17 +17,17 @@ #endif #if __GLASGOW_HASKELL__ >= 503 import Data.Array -import Data.Char (ord) import Data.Array.Base (unsafeAt) #else import Array -import Char (ord) #endif #if __GLASGOW_HASKELL__ >= 503 import GHC.Exts #else import GlaExts #endif +alex_tab_size :: Int +alex_tab_size = 8 alex_base :: AlexAddr alex_base = AlexA# "\xf8\xff\xff\xff\x72\x00\x00\x00\xe5\x00\x00\x00\xd9\xff\xff\xff\xda\xff\xff\xff\xea\x00\x00\x00\xc3\x01\x00\x00\x17\x02\x00\x00\x77\x00\x00\x00\x15\x02\x00\x00\x7c\x00\x00\x00\x0b\x03\x00\x00\x8b\x03\x00\x00\x0b\x04\x00\x00\xa3\xff\xff\xff\x8b\x04\x00\x00\x0b\x05\x00\x00\xe8\x02\x00\x00\xca\x05\x00\x00\xdc\xff\xff\xff\xdd\xff\xff\xff\xc5\x05\x00\x00\x45\x06\x00\x00\xc5\x06\x00\x00\x45\x07\x00\x00\xde\xff\xff\xff\xc5\x07\x00\x00\x45\x08\x00\x00\xc5\x08\x00\x00\x45\x09\x00\x00\xc5\x09\x00\x00\x45\x0a\x00\x00\xc5\x0a\x00\x00\x45\x0b\x00\x00\xc5\x0b\x00\x00\x45\x0c\x00\x00\xab\xff\xff\xff\x96\xff\xff\xff\x9c\xff\xff\xff\x00\x00\x00\x00\xb6\x0c\x00\x00\x00\x00\x00\x00\x27\x0d\x00\x00\x00\x00\x00\x00\x98\x0d\x00\x00\x9f\xff\xff\xff\x00\x00\x00\x00\xd9\x0d\x00\x00\x00\x00\x00\x00\x4a\x0e\x00\x00\x00\x00\x00\x00\xbb\x0e\x00\x00\x00\x00\x00\x00\xfc\x0e\x00\x00\x00\x00\x00\x00\x3d\x0f\x00\x00\x00\x00\x00\x00\xae\x0f\x00\x00\x00\x00\x00\x00\x1f\x10\x00\x00\xa0\xff\xff\xff\x1f\x11\x00\x00\xdf\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x11\x00\x00\x00\x00\x00\x00\x91\x11\x00\x00\x00\x00\x00\x00\x02\x12\x00\x00\x00\x00\x00\x00\x43\x12\x00\x00\x43\x13\x00\x00\x03\x13\x00\x00\x00\x00\x00\x00\x03\x14\x00\x00\xc3\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x14\x00\x00\x00\x00\x00\x00\x45\x14\x00\x00\x3b\x15\x00\x00\x32\x16\x00\x00\x3d\x15\x00\x00\xad\x16\x00\x00\xb8\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6e\x16\x00\x00\x00\x00\x00\x00\xaf\x16\x00\x00\xaf\x17\x00\x00\xff\x17\x00\x00\x79\x17\x00\x00\x00\x00\x00\x00\xff\x18\x00\x00\xbf\x18\x00\x00\x00\x00\x00\x00\xbf\x19\x00\x00\x7f\x19\x00\x00\x00\x00\x00\x00\xa1\xff\xff\xff\x75\x1a\x00\x00\x75\x1b\x00\x00\xd8\x19\x00\x00\x00\x00\x00\x00\xf5\x1b\x00\x00\x45\x1c\x00\x00\xbf\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x81\x00\x00\x00\x3b\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x1e\x00\x00\x00\x00\x00\x00\xe4\xff\xff\xff\x05\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\x00\x00\x00\x51\x1d\x00\x00\xc5\x00\x00\x00\x00\x00\x00\x00\xcd\x00\x00\x00\x0c\x1e\x00\x00\xe5\xff\xff\xff\x32\x1e\x00\x00\x00\x00\x00\x00\x28\x1f\x00\x00\x83\x1f\x00\x00\xf9\x1f\x00\x00\xf0\x20\x00\x00\xfc\x1f\x00\x00\x62\x21\x00\x00\x01\x20\x00\x00\x80\x21\x00\x00\x00\x00\x00\x00\x76\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# @@ -215,6 +216,178 @@ {-# LINE 1 "templates\\GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-} {-# LINE 1 "<command-line>" #-} +{-# LINE 10 "<command-line>" #-} +{-# LINE 1 "G:\\GitHub\\haskell-platform\\build\\ghc-bindist\\local\\lib/include\\ghcversion.h" #-} + + + + + + + + + + + + + + + + + +{-# LINE 10 "<command-line>" #-} +{-# LINE 1 "C:\\Users\\randy\\AppData\\Local\\Temp\\ghc9396_0\\ghc_2.h" #-} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{-# LINE 10 "<command-line>" #-} {-# LINE 1 "templates\\GenericTemplate.hs" #-} -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE @@ -271,8 +444,8 @@ narrow32Int# i where i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#` - (b2 `uncheckedShiftL#` 16#) `or#` - (b1 `uncheckedShiftL#` 8#) `or#` b0) + (b2 `uncheckedShiftL#` 16#) `or#` + (b1 `uncheckedShiftL#` 8#) `or#` b0) b3 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#))) b2 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#))) b1 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) @@ -312,30 +485,30 @@ alexScanUser user input (I# (sc)) = case alex_scan_tkn user input 0# input sc AlexNone of - (AlexNone, input') -> - case alexGetByte input of - Nothing -> + (AlexNone, input') -> + case alexGetByte input of + Nothing -> - AlexEOF - Just _ -> + AlexEOF + Just _ -> - AlexError input' + AlexError input' - (AlexLastSkip input'' len, _) -> + (AlexLastSkip input'' len, _) -> - AlexSkip input'' len + AlexSkip input'' len - (AlexLastAcc k input''' len, _) -> + (AlexLastAcc k input''' len, _) -> - AlexToken input''' len k + AlexToken input''' len k -- Push the input through the DFA, remembering the most recent accepting @@ -344,7 +517,7 @@ alex_scan_tkn user orig_input len input s last_acc = input `seq` -- strict in the input let - new_acc = (check_accs (alex_accept `quickIndex` (I# (s)))) + new_acc = (check_accs (alex_accept `quickIndex` (I# (s)))) in new_acc `seq` case alexGetByte input of @@ -358,34 +531,34 @@ base = alexIndexInt32OffAddr alex_base s offset = (base +# ord_c) check = alexIndexInt16OffAddr alex_check offset - + new_s = if GTE(offset,0#) && EQ(check,ord_c) - then alexIndexInt16OffAddr alex_table offset - else alexIndexInt16OffAddr alex_deflt s - in + then alexIndexInt16OffAddr alex_table offset + else alexIndexInt16OffAddr alex_deflt s + in case new_s of - -1# -> (new_acc, input) - -- on an error, we want to keep the input *before* the - -- character that failed, not after. - _ -> alex_scan_tkn user orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len) + -1# -> (new_acc, input) + -- on an error, we want to keep the input *before* the + -- character that failed, not after. + _ -> alex_scan_tkn user orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len) -- note that the length is increased ONLY if this is the 1st byte in a char encoding) - new_input new_s new_acc + new_input new_s new_acc } where - check_accs (AlexAccNone) = last_acc - check_accs (AlexAcc a ) = AlexLastAcc a input (I# (len)) - check_accs (AlexAccSkip) = AlexLastSkip input (I# (len)) + check_accs (AlexAccNone) = last_acc + check_accs (AlexAcc a ) = AlexLastAcc a input (I# (len)) + check_accs (AlexAccSkip) = AlexLastSkip input (I# (len)) - check_accs (AlexAccPred a predx rest) - | predx user orig_input (I# (len)) input - = AlexLastAcc a input (I# (len)) - | otherwise - = check_accs rest - check_accs (AlexAccSkipPred predx rest) - | predx user orig_input (I# (len)) input - = AlexLastSkip input (I# (len)) - | otherwise - = check_accs rest + check_accs (AlexAccPred a predx rest) + | predx user orig_input (I# (len)) input + = AlexLastAcc a input (I# (len)) + | otherwise + = check_accs rest + check_accs (AlexAccSkipPred predx rest) + | predx user orig_input (I# (len)) input + = AlexLastSkip input (I# (len)) + | otherwise + = check_accs rest data AlexLastAcc a @@ -394,9 +567,9 @@ | AlexLastSkip !AlexInput !Int instance Functor AlexLastAcc where - fmap f AlexNone = AlexNone + fmap _ AlexNone = AlexNone fmap f (AlexLastAcc x y z) = AlexLastAcc (f x) y z - fmap f (AlexLastSkip x y) = AlexLastSkip x y + fmap _ (AlexLastSkip x y) = AlexLastSkip x y data AlexAcc a user = AlexAccNone @@ -425,12 +598,8 @@ --alexRightContext :: Int -> AlexAccPred _ alexRightContext (I# (sc)) user _ _ input = case alex_scan_tkn user input 0# input sc AlexNone of - (AlexNone, _) -> False - _ -> True - -- TODO: there's no need to find the longest - -- match when checking the right context, just - -- the first match will do. - - --- used by wrappers -iUnbox (I# (i)) = i + (AlexNone, _) -> False + _ -> True + -- TODO: there's no need to find the longest + -- match when checking the right context, just + -- the first match will do.