Hello community, here is the log from the commit of package alex for openSUSE:Factory checked in at 2015-05-21 08:10:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alex (Old) and /work/SRC/openSUSE:Factory/.alex.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alex" Changes: -------- --- /work/SRC/openSUSE:Factory/alex/alex.changes 2014-11-26 20:54:32.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.alex.new/alex.changes 2015-05-21 08:10:53.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Apr 10 13:35:55 UTC 2015 - mimi...@gmail.com + +- update to 3.1.4 +* Add Applicative/Functor instances for GHC 7.10 + +------------------------------------------------------------------- Old: ---- alex-3.1.3.tar.gz New: ---- alex-3.1.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alex.spec ++++++ --- /var/tmp/diff_new_pack.xHfC0T/_old 2015-05-21 08:10:54.000000000 +0200 +++ /var/tmp/diff_new_pack.xHfC0T/_new 2015-05-21 08:10:54.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package alex # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2012 Peter Trommler peter.tromm...@ohm-hochschule.de # # All modifications and additions to the file contributed by third parties @@ -17,26 +17,34 @@ # +%bcond_without tests + Name: alex -Version: 3.1.3 +Version: 3.1.4 Release: 0 Summary: Tool for generating lexical analysers in Haskell License: BSD-3-Clause Group: Development/Languages/Other BuildRoot: %{_tmppath}/%{name}-%{version}-build -# BEGIN cabal2spec Url: http://hackage.haskell.org/package/%{name} Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz BuildRequires: autoconf BuildRequires: ghc-Cabal-devel BuildRequires: ghc-QuickCheck-devel +BuildRequires: ghc-array-devel +BuildRequires: ghc-containers-devel +BuildRequires: ghc-directory-devel BuildRequires: ghc-rpm-macros -# END cabal2spec +%if %{with tests} +BuildRequires: ghc-process-devel +%endif %description -Tool for generating lexical analysers in Haskell similar to lex - +Alex is a tool for generating lexical analysers in Haskell. It takes a +description of tokens based on regular expressions and generates a Haskell +module containing code for scanning text efficiently. It is similar to the tool +lex or flex for C/C++. %prep %setup -q @@ -52,6 +60,11 @@ mkdir -p %{buildroot}/%{_mandir}/man1 cp doc/alex.1 %{buildroot}/%{_mandir}/man1 +%check +%if %{with tests} +%cabal test +%endif + %files %defattr(-,root,root,-) %doc LICENSE ANNOUNCE README TODO ++++++ alex-3.1.3.tar.gz -> alex-3.1.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alex-3.1.3/alex.cabal new/alex-3.1.4/alex.cabal --- old/alex-3.1.3/alex.cabal 2013-11-28 09:35:19.000000000 +0100 +++ new/alex-3.1.4/alex.cabal 2015-01-06 21:50:22.000000000 +0100 @@ -1,5 +1,5 @@ name: alex -version: 3.1.3 +version: 3.1.4 license: BSD3 license-file: LICENSE copyright: (c) Chis Dornan, Simon Marlow @@ -16,6 +16,10 @@ for scanning text efficiently. It is similar to the tool lex or flex for C/C++. . + Changes in 3.1.4: + . + * Add Applicative/Functor instances for GHC 7.10 + . Changes in 3.1.3: . * Fix for clang (XCode 5) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alex-3.1.3/dist/build/alex/alex-tmp/Parser.hs new/alex-3.1.4/dist/build/alex/alex-tmp/Parser.hs --- old/alex-3.1.3/dist/build/alex/alex-tmp/Parser.hs 2013-11-28 09:35:19.000000000 +0100 +++ new/alex-3.1.4/dist/build/alex/alex-tmp/Parser.hs 2015-01-06 21:50:22.000000000 +0100 @@ -20,8 +20,9 @@ --import Debug.Trace import qualified Data.Array as Happy_Data_Array import qualified GHC.Exts as Happy_GHC_Exts +import Control.Applicative(Applicative(..)) --- parser produced by Happy Version 1.19.0 +-- parser produced by Happy Version 1.19.4 newtype HappyAbsSyn = HappyAbsSyn HappyAny #if __GLASGOW_HASKELL__ >= 607 @@ -880,6 +881,7 @@ +-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. #if __GLASGOW_HASKELL__ > 706 #define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool) #define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool) @@ -889,7 +891,7 @@ #define GTE(n,m) (n Happy_GHC_Exts.>=# m) #define EQ(n,m) (n Happy_GHC_Exts.==# m) #endif -{-# LINE 45 "templates/GenericTemplate.hs" #-} +{-# LINE 46 "templates/GenericTemplate.hs" #-} data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList @@ -898,11 +900,11 @@ -{-# LINE 66 "templates/GenericTemplate.hs" #-} +{-# LINE 67 "templates/GenericTemplate.hs" #-} -{-# LINE 76 "templates/GenericTemplate.hs" #-} +{-# LINE 77 "templates/GenericTemplate.hs" #-} -{-# LINE 85 "templates/GenericTemplate.hs" #-} +{-# LINE 86 "templates/GenericTemplate.hs" #-} infixr 9 `HappyStk` data HappyStk a = HappyStk a (HappyStk a) @@ -919,9 +921,9 @@ -- parse (a %partial parser). We must ignore the saved token on the top of -- the stack in this case. happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) = - happyReturn1 ans + happyReturn1 ans happyAccept j tk st sts (HappyStk ans _) = - (happyTcHack j (happyTcHack st)) (happyReturn1 ans) + (happyTcHack j (happyTcHack st)) (happyReturn1 ans) ----------------------------------------------------------------------------- -- Arrays only: do the next action @@ -929,35 +931,35 @@ happyDoAction i tk st - = {- nothing -} + = {- nothing -} - case action of - 0# -> {- nothing -} - happyFail i tk st - -1# -> {- nothing -} - happyAccept i tk st - n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -} + case action of + 0# -> {- nothing -} + happyFail i tk st + -1# -> {- nothing -} + happyAccept i tk st + n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -} - (happyReduceArr Happy_Data_Array.! rule) i tk st - where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#)))))) - n -> {- nothing -} + (happyReduceArr Happy_Data_Array.! rule) i tk st + where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#)))))) + n -> {- nothing -} - happyShift new_state i tk st + happyShift new_state i tk st where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) where off = indexShortOffAddr happyActOffsets st off_i = (off Happy_GHC_Exts.+# i) - check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#)) + check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#)) then EQ(indexShortOffAddr happyCheck off_i, i) - else False + else False action | check = indexShortOffAddr happyTable off_i | otherwise = indexShortOffAddr happyDefActions st indexShortOffAddr (HappyA# arr) off = - Happy_GHC_Exts.narrow16Int# i + Happy_GHC_Exts.narrow16Int# i where i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low) high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#))) @@ -976,7 +978,7 @@ ----------------------------------------------------------------------------- -- HappyState data type (not arrays) -{-# LINE 169 "templates/GenericTemplate.hs" #-} +{-# LINE 170 "templates/GenericTemplate.hs" #-} ----------------------------------------------------------------------------- -- Shifting a token @@ -1018,9 +1020,9 @@ = happyFail 0# tk st sts stk happyReduce k nt fn j tk st sts stk = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of - sts1@((HappyCons (st1@(action)) (_))) -> - let r = fn stk in -- it doesn't hurt to always seq here... - happyDoSeq r (happyGoto nt j tk st1 sts1 r) + sts1@((HappyCons (st1@(action)) (_))) -> + let r = fn stk in -- it doesn't hurt to always seq here... + happyDoSeq r (happyGoto nt j tk st1 sts1 r) happyMonadReduce k nt fn 0# tk st sts stk = happyFail 0# tk st sts stk @@ -1072,7 +1074,7 @@ -- parse error if we are in recovery and we fail again happyFail 0# tk old_st _ stk@(x `HappyStk` _) = let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in --- trace "failing" $ +-- trace "failing" $ happyError_ i tk {- We don't need state discarding for our restricted implementation of @@ -1081,16 +1083,16 @@ -- discard a state happyFail 0# tk old_st (HappyCons ((action)) (sts)) - (saved_tok `HappyStk` _ `HappyStk` stk) = --- trace ("discarding state, depth " ++ show (length stk)) $ - happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk)) + (saved_tok `HappyStk` _ `HappyStk` stk) = +-- trace ("discarding state, depth " ++ show (length stk)) $ + happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk)) -} -- Enter error recovery: generate an error token, -- save the old token and carry on. happyFail i tk (action) sts stk = -- trace "entering error recovery" $ - happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk) + happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk) -- Internal happy errors: @@ -1108,9 +1110,9 @@ ----------------------------------------------------------------------------- -- Seq-ing. If the --strict flag is given, then Happy emits --- happySeq = happyDoSeq +-- happySeq = happyDoSeq -- otherwise it emits --- happySeq = happyDontSeq +-- happySeq = happyDontSeq happyDoSeq, happyDontSeq :: a -> b -> b happyDoSeq a b = a `seq` b diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alex-3.1.3/dist/build/alex/alex-tmp/Scan.hs new/alex-3.1.4/dist/build/alex/alex-tmp/Scan.hs --- old/alex-3.1.3/dist/build/alex/alex-tmp/Scan.hs 2013-11-28 09:35:19.000000000 +0100 +++ new/alex-3.1.4/dist/build/alex/alex-tmp/Scan.hs 2015-01-06 21:50:22.000000000 +0100 @@ -231,7 +231,6 @@ --- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. #if __GLASGOW_HASKELL__ > 706 #define GTE(n,m) (tagToEnum# (n >=# m)) #define EQ(n,m) (tagToEnum# (n ==# m)) @@ -239,11 +238,11 @@ #define GTE(n,m) (n >=# m) #define EQ(n,m) (n ==# m) #endif -{-# LINE 51 "templates/GenericTemplate.hs" #-} +{-# LINE 50 "templates/GenericTemplate.hs" #-} data AlexAddr = AlexA# Addr# --- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. + #if __GLASGOW_HASKELL__ < 503 uncheckedShiftL# = shiftL# #endif @@ -284,7 +283,6 @@ - #if __GLASGOW_HASKELL__ < 503 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alex-3.1.3/src/NFA.hs new/alex-3.1.4/src/NFA.hs --- old/alex-3.1.3/src/NFA.hs 2013-11-28 09:35:19.000000000 +0100 +++ new/alex-3.1.4/src/NFA.hs 2015-01-06 21:50:22.000000000 +0100 @@ -23,7 +23,8 @@ import qualified Map hiding ( Map ) import Util ( str, space ) -import Control.Monad ( forM_, zipWithM, zipWithM_, when ) +import Control.Applicative ( Applicative(..) ) +import Control.Monad ( forM_, zipWithM, zipWithM_, when, liftM, ap ) import Data.Array ( Array, (!), array, listArray, assocs, bounds ) -- Each state of a nondeterministic automaton contains a list of `Accept' @@ -162,6 +163,13 @@ newtype NFAM a = N {unN :: SNum -> MapNFA -> Encoding -> (SNum, MapNFA, a)} +instance Functor NFAM where + fmap = liftM + +instance Applicative NFAM where + pure = return + (<*>) = ap + instance Monad NFAM where return a = N $ \s n _ -> (s,n,a) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alex-3.1.3/src/ParseMonad.hs new/alex-3.1.4/src/ParseMonad.hs --- old/alex-3.1.3/src/ParseMonad.hs 2013-11-28 09:35:19.000000000 +0100 +++ new/alex-3.1.4/src/ParseMonad.hs 2015-01-06 21:50:22.000000000 +0100 @@ -19,6 +19,9 @@ import Map ( Map ) import qualified Map hiding ( Map ) import UTF8 + +import Control.Applicative ( Applicative(..) ) +import Control.Monad ( liftM, ap ) import Data.Word (Word8) -- ----------------------------------------------------------------------------- -- The input type @@ -84,6 +87,13 @@ newtype P a = P { unP :: PState -> Either ParseError (PState,a) } +instance Functor P where + fmap = liftM + +instance Applicative P where + pure = return + (<*>) = ap + instance Monad P where (P m) >>= k = P $ \env -> case m env of Left err -> Left err diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alex-3.1.3/templates/wrappers.hs new/alex-3.1.4/templates/wrappers.hs --- old/alex-3.1.3/templates/wrappers.hs 2013-11-28 09:35:19.000000000 +0100 +++ new/alex-3.1.4/templates/wrappers.hs 2015-01-06 21:50:22.000000000 +0100 @@ -4,6 +4,7 @@ -- This code is in the PUBLIC DOMAIN; you may copy it freely and use -- it for any purpose whatsoever. +import Control.Applicative (Applicative (..)) import Data.Word (Word8) #if defined(ALEX_BASIC_BYTESTRING) || defined(ALEX_POSN_BYTESTRING) || defined(ALEX_MONAD_BYTESTRING) @@ -173,6 +174,19 @@ newtype Alex a = Alex { unAlex :: AlexState -> Either String (AlexState, a) } +instance Functor Alex where + fmap f a = Alex $ \s -> case unAlex a s of + Left msg -> Left msg + Right (s', a') -> Right (s', f a') + +instance Applicative Alex where + pure a = Alex $ \s -> Right (s, a) + fa <*> a = Alex $ \s -> case unAlex fa s of + Left msg -> Left msg + Right (s', f) -> case unAlex a s' of + Left msg -> Left msg + Right (s'', b) -> Right (s'', f b) + instance Monad Alex where m >>= k = Alex $ \s -> case unAlex m s of Left msg -> Left msg