summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuYamamoto <>2017-11-14 08:20:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-11-14 08:20:00 (GMT)
commit101ad360d39004755c16713b008a1fba79ce7cbb (patch)
treed9da903c090052a0f8739ebdc61a858bb47c6d6d
parent5b372600b2834f1f79990fa7f6b4aded942b35da (diff)
version 0.5.3HEAD0.5.3master
-rw-r--r--piki.cabal5
-rw-r--r--src/CharParser.hs2
-rw-r--r--src/Main.hs4
-rw-r--r--src/Parsec.hs17
-rw-r--r--src/Piki.hs6
5 files changed, 13 insertions, 21 deletions
diff --git a/piki.cabal b/piki.cabal
index 40e20c0..497211c 100644
--- a/piki.cabal
+++ b/piki.cabal
@@ -1,5 +1,5 @@
Name: piki
-Version: 0.5.2
+Version: 0.5.3
Author: Kazu Yamamoto <kazu@iij.ad.jp>
Maintainer: Kazu Yamamoto <kazu@iij.ad.jp>
License: BSD3
@@ -29,7 +29,7 @@ Executable piki
else
GHC-Options: -Wall
Build-Depends: base >= 4.0 && < 5,
- parsec >= 3, text, mtl
+ parsec >= 3.1.11, text, mtl
Other-Modules: Builder
CharParser
Html
@@ -39,6 +39,7 @@ Executable piki
Parsec
Piki
Types
+ Paths_piki
Source-Repository head
Type: git
Location: git://github.com/kazu-yamamoto/piki.git
diff --git a/src/CharParser.hs b/src/CharParser.hs
index 3fd3a5c..f8a92ae 100644
--- a/src/CharParser.hs
+++ b/src/CharParser.hs
@@ -81,7 +81,7 @@ quoted = L.pack <$> (open *> inside <* close)
close = char '"'
unquoted :: Parser L.Text
-unquoted = L.pack <$> (many1 $ noneOf " \t\n[]\"")
+unquoted = L.pack <$> many1 (noneOf " \t\n[]\"")
----------------------------------------------------------------
diff --git a/src/Main.hs b/src/Main.hs
index 9b4827f..a6c203b 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -2,8 +2,10 @@ module Main where
import Control.Applicative
import qualified Data.Text.Lazy.IO as L
+import qualified Data.Version as V
import Html
import Markdown
+import qualified Paths_piki as V
import Piki
import System.Console.GetOpt
import System.Environment
@@ -11,7 +13,7 @@ import System.Environment
----------------------------------------------------------------
version :: String
-version = "0.5.2"
+version = V.showVersion V.version
printVersion :: IO ()
printVersion = putStrLn $ "piki version " ++ version
diff --git a/src/Parsec.hs b/src/Parsec.hs
index 25c0071..f9a360e 100644
--- a/src/Parsec.hs
+++ b/src/Parsec.hs
@@ -1,21 +1,12 @@
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-module Parsec (
- module Control.Applicative
- , module Text.Parsec
- , module Text.Parsec.Error
- , Parser, LineParser
- ) where
+module Parsec (module AP, Parser, LineParser) where
-import Control.Applicative hiding (many,optional,(<|>))
+import Control.Applicative as AP hiding (many,optional,(<|>))
import qualified Data.Text.Lazy as L
-import Text.Parsec hiding (satisfy, ParseError, errorPos)
-import Text.Parsec.Error
-import Text.Parsec.Prim
+import Text.Parsec as AP hiding (satisfy, ParseError, errorPos)
+import Text.Parsec.Error as AP
type Parser = Parsec L.Text ()
type LineParser = Parsec [L.Text] ()
-
-instance Monad m => Stream L.Text m Char where
- uncons = return . L.uncons
diff --git a/src/Piki.hs b/src/Piki.hs
index 99d0651..3ed2b24 100644
--- a/src/Piki.hs
+++ b/src/Piki.hs
@@ -4,7 +4,7 @@ module Piki (piki) where
import CharParser
import Data.Char
-import Data.List (intersperse)
+import Data.List (intercalate)
import qualified Data.Text.Lazy as L
import LineParser
import Notation
@@ -143,9 +143,7 @@ division = DIV <$> attr <*> elts <* close
----------------------------------------------------------------
paragraph :: LineParser Element
-paragraph = P <$> parag
- where
- parag = concat . intersperse [R '\n'] <$> many1 paragLine
+paragraph = P . intercalate [R '\n'] <$> many1 paragLine
paragLine :: LineParser XText
paragLine = firstChar (`notElem` pikiReserved) >>= getText