Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

version 0.2.2

  • Loading branch information...
commit d2f9a47e8ae910f02bc6aa0b4ab50850753ae6db 1 parent 2d97dd2
@stevezhee authored
View
2  .gitignore
@@ -0,0 +1,2 @@
+.shake.*
+dist
View
20 Language/Pec/Par.hs
@@ -3155,14 +3155,14 @@ happySeq = happyDontSeq
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "templates\GenericTemplate.hs" #-}
+{-# LINE 1 "templates\\GenericTemplate.hs" #-}
{-# LINE 1 "<built-in>" #-}
{-# LINE 1 "<command-line>" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "templates\\GenericTemplate.hs" #-}
-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp
-{-# LINE 30 "templates/GenericTemplate.hs" #-}
+{-# LINE 30 "templates\\GenericTemplate.hs" #-}
@@ -3171,11 +3171,11 @@ happySeq = happyDontSeq
-{-# LINE 51 "templates/GenericTemplate.hs" #-}
+{-# LINE 51 "templates\\GenericTemplate.hs" #-}
-{-# LINE 61 "templates/GenericTemplate.hs" #-}
+{-# LINE 61 "templates\\GenericTemplate.hs" #-}
-{-# LINE 70 "templates/GenericTemplate.hs" #-}
+{-# LINE 70 "templates\\GenericTemplate.hs" #-}
infixr 9 `HappyStk`
data HappyStk a = HappyStk a (HappyStk a)
@@ -3199,7 +3199,7 @@ happyAccept j tk st sts (HappyStk ans _) =
-----------------------------------------------------------------------------
-- Arrays only: do the next action
-{-# LINE 148 "templates/GenericTemplate.hs" #-}
+{-# LINE 148 "templates\\GenericTemplate.hs" #-}
-----------------------------------------------------------------------------
-- HappyState data type (not arrays)
@@ -3290,7 +3290,7 @@ happyDropStk n (x `HappyStk` xs) = happyDropStk (n - ((1)::Int)) xs
-----------------------------------------------------------------------------
-- Moving to a new state after a reduction
-{-# LINE 246 "templates/GenericTemplate.hs" #-}
+{-# LINE 246 "templates\\GenericTemplate.hs" #-}
happyGoto action j tk st = action j j tk (HappyState action)
@@ -3348,7 +3348,7 @@ happyDontSeq a b = b
-- of deciding to inline happyGoto everywhere, which increases the size of
-- the generated parser quite a bit.
-{-# LINE 311 "templates/GenericTemplate.hs" #-}
+{-# LINE 311 "templates\\GenericTemplate.hs" #-}
{-# NOINLINE happyShift #-}
{-# NOINLINE happySpecReduce_0 #-}
{-# NOINLINE happySpecReduce_1 #-}
View
6 MkPec.hs
@@ -20,8 +20,8 @@ data Args = Args
copyright :: String
copyright = "(C) Brett Letner 2011-2012"
-version :: String
-version = "0.0.1"
+vers :: String
+vers = "0.2.2"
argsDesc :: Args
argsDesc = Args
@@ -29,7 +29,7 @@ argsDesc = Args
} &= summary summry &= program prog
summry :: String
-summry = prog ++ " v" ++ version ++ ", " ++ copyright
+summry = prog ++ " v" ++ vers ++ ", " ++ copyright
prog :: String
prog = "MkPec.exe"
View
4 Pec/Base.hs
@@ -20,10 +20,8 @@ import Data.Data
import Data.Generics.Uniplate.Data
import Data.List
import Development.Shake.FilePath
-import Distribution.Text
import Grm.Prims
import Language.Pir.Abs hiding (Exp(..))
-import Paths_pec
import Pec.C
import Pec.IUtil (vtvar, gTyDecls)
import Pec.PUtil
@@ -45,7 +43,7 @@ argsDesc = Args
} &= summary summry &= program prog
summry :: String
-summry = prog ++ " v" ++ display version ++ ", " ++ copyright
+summry = prog ++ " v" ++ vers ++ ", " ++ copyright
prog :: String
prog = "pecgen"
View
10 Pec/IUtil.hs
@@ -5,16 +5,14 @@
module Pec.IUtil where
-import Data.List
-import Grm.Prims
--- import Text.PrettyPrint.Leijen
--- import qualified Language.Haskell as H
-import Language.Pir.Abs
import Control.Concurrent
import Data.Char
import Data.Generics.Uniplate.Data
-import System.IO.Unsafe
+import Data.List
import Data.Maybe
+import Grm.Prims
+import Language.Pir.Abs
+import System.IO.Unsafe
gTyDecls :: MVar [(Type,TyDecl)]
gTyDecls = unsafePerformIO $ newMVar []
View
11 Pec/PUtil.hs
@@ -24,10 +24,17 @@ import qualified Language.Pec.Abs as P
copyright :: String
copyright = "(C) Brett Letner 2011-2012"
+vers :: String
+vers = display version
+
+getLibDir :: IO FilePath
+getLibDir = liftM takeDirectory $ getDataFileName "lib/Prelude.pec"
+
parse_pec :: FilePath -> IO (P.Module Point)
parse_pec fn = do
ts <- P.grmLexFilePath fn
- let m@(P.Module _ a _ _ _) = grmParse $ layout $ filter notWSToken ts
+ m@(P.Module _ a _ _ _) <-
+ return $ grmParse $ layout $ filter notWSToken ts
if ((splitDirectories $ dropExtension $ normalise fn) `has_suffix`
(unqual $ ppShow a))
then return m
@@ -76,7 +83,7 @@ splitBy p = loop [] []
| otherwise = loop (c:xs) ys cs
summarize :: String -> String
-summarize prog = prog ++ " v" ++ display version ++ ", " ++ copyright
+summarize prog = prog ++ " v" ++ vers ++ ", " ++ copyright
readFileDeps :: FilePath -> IO ([String],[Integer])
readFileDeps = liftM read . readFile
View
11 pec.cabal
@@ -1,6 +1,6 @@
Name: pec
-Version: 0.2.1
+Version: 0.2.2
Synopsis: pec embedded compiler
@@ -29,20 +29,21 @@ source-repository head
location: git://github.com/stevezhee/pec.git
Library
- Exposed-modules: Pec.Base, Pec.C, Pec.LLVM, Pec.PUtil, Pec.HUtil, Pec.IUtil, Pec.Desugar, Language.Pec.Abs, Language.Pec.Par, Language.Pir.Abs, Language.C.Abs, Language.LLVM.Abs, Language.Pds.Abs
+ Exposed-modules: Language.Pec.Par, Language.Pir.Abs, Language.C.Abs, Language.LLVM.Abs, Language.Pds.Abs, Pec.Base, Pec.C, Pec.LLVM, Pec.Desugar, Language.Pec.Abs, Pec.PUtil, Pec.HUtil, Pec.IUtil
+ Other-modules: Paths_pec
Build-depends: base < 5, mtl, grm, Cabal, uniplate, derive, wl-pprint, syb, deepseq, array, containers, shake, cmdargs
Executable pecgen
Main-is: PecGen.hs
Build-depends: pec, base < 5, derive, wl-pprint, filepath, cmdargs, grm, Cabal, syb, deepseq, uniplate, mtl, directory, shake
- Hs-Source-Dirs: src, .
+ Hs-Source-Dirs: src
Executable pec
Main-is: Pec.hs
Build-depends: pec, base < 5, old-time, process, filepath, directory, cmdargs, grm, Cabal, wl-pprint, syb, deepseq, uniplate, mtl, shake
- Hs-Source-Dirs: src, .
+ Hs-Source-Dirs: src
Executable pecgencnt
Main-is: PecGenCnt.hs
Build-depends: pec, base < 5, derive, cmdargs, grm, Cabal, wl-pprint, syb, deepseq, uniplate, mtl, filepath, shake
- Hs-Source-Dirs: src, .
+ Hs-Source-Dirs: src
View
6 src/Pec.hs
@@ -10,9 +10,7 @@ import Control.Monad
import Data.List
import Development.Shake hiding (getDirectoryContents)
import Development.Shake.FilePath
-import Distribution.Text
import Grm.Prims
-import Paths_pec
import Pec.PUtil
import System.Console.CmdArgs
import System.Directory hiding (readable)
@@ -37,7 +35,7 @@ argsDesc = Args
} &= summary summry &= program prog
summry :: String
-summry = prog ++ " v" ++ display version ++ ", " ++ copyright
+summry = prog ++ " v" ++ vers ++ ", " ++ copyright
prog :: String
prog = "pec"
@@ -63,7 +61,7 @@ rmrf fn = do
main :: IO ()
main = do
a <- cmdArgs argsDesc
- libDir <- liftM takeDirectory $ getDataFileName "lib/Prelude.pec"
+ libDir <- getLibDir
let idirs = ["."] ++ idir a ++ [libDir]
when ("clean" `elem` targets a) $ do
Please sign in to comment.
Something went wrong with that request. Please try again.