DPM 0.1.0 → 0.2.0
raw patch · 2 files changed
+75/−117 lines, 2 filesdep ~darcsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: darcs
API changes (from Hackage documentation)
Files
- DPM.cabal +4/−3
- dist/build/dpm/dpm-tmp/DPM/Core/Lexer.hs +71/−114
DPM.cabal view
@@ -1,5 +1,5 @@ Name: DPM-Version: 0.1.0+Version: 0.2.0 License: GPL License-File: LICENSE Copyright: (c) 2009-2010 Stefan Wehr@@ -20,6 +20,7 @@ Stability: Beta Cabal-Version: >= 1.6 Build-Type: Simple+Tested-with: GHC==6.10.4, GHC==6.12.1 flag test description: Enable the test configuration: Build the test@@ -32,7 +33,7 @@ Other-Modules: DPM.Core.Lexer, DPM.Core.QueryParser -- WARNING: The build-depends property is duplicated for the dpm executable. -- Can we avoid this somehow?- Build-Depends: darcs >= 2.3.0+ Build-Depends: darcs >= 2.4 , bytestring >= 0.9 , time , old-locale@@ -60,7 +61,7 @@ Main-Is: CommandlineMain.hs Hs-Source-Dirs: src Other-Modules: DPM.Core.Lexer, DPM.Core.QueryParser- Build-Depends: darcs >= 2.3.0+ Build-Depends: darcs >= 2.4 , bytestring >= 0.9 , time , old-locale
dist/build/dpm/dpm-tmp/DPM/Core/Lexer.hs view
@@ -1,12 +1,11 @@ {-# OPTIONS -fglasgow-exts -cpp #-} {-# LINE 1 "src/DPM/Core/Lexer.x" #-}- {-# OPTIONS_GHC -w #-} module DPM.Core.Lexer (scan, Token(..)) where #if __GLASGOW_HASKELL__ >= 603 #include "ghcconfig.h"-#elif defined(__GLASGOW_HASKELL__)+#else #include "config.h" #endif #if __GLASGOW_HASKELL__ >= 503@@ -22,99 +21,6 @@ #else import GlaExts #endif-{-# LINE 1 "templates/wrappers.hs" #-}-{-# LINE 1 "templates/wrappers.hs" #-}-{-# LINE 1 "<built-in>" #-}-{-# LINE 1 "<command-line>" #-}-{-# LINE 1 "templates/wrappers.hs" #-}--- -------------------------------------------------------------------------------- Alex wrapper code.------ This code is in the PUBLIC DOMAIN; you may copy it freely and use--- it for any purpose whatsoever.--{-# LINE 18 "templates/wrappers.hs" #-}---- -------------------------------------------------------------------------------- The input type--{-# LINE 35 "templates/wrappers.hs" #-}--{-# LINE 51 "templates/wrappers.hs" #-}---- -------------------------------------------------------------------------------- Token positions---- `Posn' records the location of a token in the input text. It has three--- fields: the address (number of chacaters preceding the token), line number--- and column of a token within the file. `start_pos' gives the position of the--- start of the file and `eof_pos' a standard encoding for the end of file.--- `move_pos' calculates the new position after traversing a given character,--- assuming the usual eight character tab stops.--{-# LINE 74 "templates/wrappers.hs" #-}---- -------------------------------------------------------------------------------- Default monad--{-# LINE 162 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Monad (with ByteString input)--{-# LINE 251 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Basic wrapper---type AlexInput = (Char,String)--alexGetChar (_, []) = Nothing-alexGetChar (_, c:cs) = Just (c, (c,cs))--alexInputPrevChar (c,_) = c---- alexScanTokens :: String -> [token]-alexScanTokens str = go ('\n',str)- where go inp@(_,str) =- case alexScan inp 0 of- AlexEOF -> []- AlexError _ -> error "lexical error"- AlexSkip inp' len -> go inp'- AlexToken inp' len act -> act (take len str) : go inp'------ -------------------------------------------------------------------------------- Basic wrapper, ByteString version--{-# LINE 297 "templates/wrappers.hs" #-}--{-# LINE 322 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Posn wrapper---- Adds text positions to the basic model.--{-# LINE 339 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Posn wrapper, ByteString version--{-# LINE 354 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- GScan wrapper---- For compatibility with previous versions of Alex, and because we can.- alex_base :: AlexAddr alex_base = AlexA# "\xf8\xff\xff\xff\xfd\xff\xff\xff\x02\x00\x00\x00\x07\x00\x00\x00\x1f\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x00\x00\x00\x30\x00\x00\x00"# @@ -130,7 +36,6 @@ alex_accept = listArray (0::Int,11) [[],[],[(AlexAcc (alex_action_0))],[],[],[(AlexAcc (alex_action_1))],[(AlexAcc (alex_action_2))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_6))],[(AlexAcc (alex_action_6))]] {-# LINE 18 "src/DPM/Core/Lexer.x" #-} - data Token = TSpecial -- ':' | TNot -- '^' | TAnd -- ' '@@ -143,18 +48,17 @@ scan :: String -> [Token] scan = alexScanTokens -alex_action_0 = \_ -> TOr -alex_action_1 = \_ -> TAnd -alex_action_2 = \_ -> TSpecial -alex_action_3 = \_ -> TNot -alex_action_4 = \_ -> TOpen -alex_action_5 = \_ -> TClose -alex_action_6 = TString -{-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# LINE 1 "templates/GenericTemplate.hs" #-}+alex_action_0 = \_ -> TOr +alex_action_1 = \_ -> TAnd +alex_action_2 = \_ -> TSpecial +alex_action_3 = \_ -> TNot +alex_action_4 = \_ -> TOpen +alex_action_5 = \_ -> TClose +alex_action_6 = TString +{-# LINE 1 "GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-}-{-# LINE 1 "<command-line>" #-}-{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<command line>" #-}+{-# LINE 1 "GenericTemplate.hs" #-} -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE --@@ -164,9 +68,9 @@ -- ----------------------------------------------------------------------------- -- INTERNALS and main scanner engine -{-# LINE 37 "templates/GenericTemplate.hs" #-}+{-# LINE 35 "GenericTemplate.hs" #-} -{-# LINE 47 "templates/GenericTemplate.hs" #-}+{-# LINE 45 "GenericTemplate.hs" #-} data AlexAddr = AlexA# Addr#@@ -280,12 +184,12 @@ let- !(base) = alexIndexInt32OffAddr alex_base s- !((I# (ord_c))) = ord c- !(offset) = (base +# ord_c)- !(check) = alexIndexInt16OffAddr alex_check offset+ base = alexIndexInt32OffAddr alex_base s+ (I# (ord_c)) = ord c+ offset = (base +# ord_c)+ check = alexIndexInt16OffAddr alex_check offset - !(new_s) = if (offset >=# 0#) && (check ==# ord_c)+ new_s = if (offset >=# 0#) && (check ==# ord_c) then alexIndexInt16OffAddr alex_table offset else alexIndexInt16OffAddr alex_deflt s in@@ -344,3 +248,56 @@ -- used by wrappers iUnbox (I# (i)) = i+{-# LINE 1 "wrappers.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command line>" #-}+{-# LINE 1 "wrappers.hs" #-}+-- -----------------------------------------------------------------------------+-- Alex wrapper code.+--+-- This code is in the PUBLIC DOMAIN; you may copy it freely and use+-- it for any purpose whatsoever.++-- -----------------------------------------------------------------------------+-- The input type++{-# LINE 44 "wrappers.hs" #-}++-- -----------------------------------------------------------------------------+-- Default monad++{-# LINE 126 "wrappers.hs" #-}++-- -----------------------------------------------------------------------------+-- Basic wrapper+++type AlexInput = (Char,String)++alexGetChar (_, []) = Nothing+alexGetChar (_, c:cs) = Just (c, (c,cs))++alexInputPrevChar (c,_) = c++-- alexScanTokens :: String -> [token]+alexScanTokens str = go ('\n',str)+ where go inp@(_,str) =+ case alexScan inp 0 of+ AlexEOF -> []+ AlexError _ -> error "lexical error"+ AlexSkip inp' len -> go inp'+ AlexToken inp' len act -> act (take len str) : go inp'+++-- -----------------------------------------------------------------------------+-- Posn wrapper++-- Adds text positions to the basic model.++{-# LINE 163 "wrappers.hs" #-}++-- -----------------------------------------------------------------------------+-- GScan wrapper++-- For compatibility with previous versions of Alex, and because we can.+