orgmode-parse 0.0.0.3 → 0.0.1.0
raw patch · 5 files changed
+56/−25 lines, 5 filesdep +HUnitdep +tastydep +tasty-hunit
Dependencies added: HUnit, tasty, tasty-hunit, unordered-containers
Files
- README.org +5/−1
- orgmode-parse.cabal +20/−21
- src/Data/OrgMode/Parse.hs +3/−2
- src/Data/OrgMode/Parse/Internal.hs +10/−1
- test/Test.hs +18/−0
README.org view
@@ -1,3 +1,7 @@ * Welcome!- This is a reference implementation of a [[https://github.com/msgheap/structmsg/blob/master/SPECIFICATION.org][structmsg]] parser in Haskell.+ [[https://hackage.haskell.org/package/orgmode-parse][https://img.shields.io/hackage/v/orgmode-parse.svg?style=flat]]+ [[https://travis-ci.org/digitalmentat/orgmode-parse][https://travis-ci.org/digitalmentat/orgmode-parse.svg?branch=master]]++ This is a reference implementation of an [[https://github.com/msgheap/orgmode-grammar/blob/master/SPECIFICATION.org][orgmode-grammar]] parser in+ Haskell.
orgmode-parse.cabal view
@@ -1,7 +1,7 @@ Name: orgmode-parse-Version: 0.0.0.3-Author: Parnell <parnell@digitalmentat.com>-Maintainer: Parnell <parnell@digitalmentat.com>+Version: 0.0.1.0+Author: Parnell Springmeyer <parnell@digitalmentat.com>+Maintainer: Parnell Springmeyer <parnell@digitalmentat.com> License: BSD3 License-File: LICENSE Category: Data@@ -39,28 +39,27 @@ Build-Depends: base >= 4.4 && < 5, attoparsec >= 0.12 && < 0.13,+ unordered-containers >= 0.2 && < 0.3, free >= 4.9 && < 5, text >= 1.0 && < 2.0 --- Test-Suite tests--- Type: exitcode-stdio-1.0--- Default-Language: Haskell2010--- Hs-Source-Dirs: test, src--- Ghc-Options: -Wall--- Main-Is: Test.hs--- Other-Modules:--- Data.OrgMode.Parse--- Data.OrgMode.Parse.Internal,--- Data.OrgMode.Parse.Attoparsec--- Data.OrgMode.Parse.Attoparsec.Headings+Test-Suite tests+ Type: exitcode-stdio-1.0+ Default-Language: Haskell2010+ Hs-Source-Dirs: test, src+ Ghc-Options: -Wall+ Main-Is: Test.hs+ Other-Modules:+ Data.OrgMode.Parse --- Build-Depends:--- base >= 4.4 && < 5,--- text >= 1.0 && < 2.0,--- attoparsec >= 0.12 && < 0.13,--- HUnit >= 1.2.5.2 && < 1.3,--- tasty >= 0.8 && < 0.9,--- tasty-hunit >= 0.8.0.1 && < 0.9+ Build-Depends:+ base >= 4.4 && < 5,+ text >= 1.0 && < 2.0,+ attoparsec >= 0.12 && < 0.13,+ unordered-containers >= 0.2 && < 0.3,+ HUnit >= 1.2.5.2 && < 1.3,+ tasty >= 0.8 && < 0.9,+ tasty-hunit >= 0.8.0.1 && < 0.9 Source-Repository head Type: git
src/Data/OrgMode/Parse.hs view
@@ -14,10 +14,11 @@ -- * Parse Document -- * Parse Headline-module Data.OrgMode.Parse.Attoparsec.Headings+ module Data.OrgMode.Parse.Attoparsec.Headings -- * Parse Headline Metadata (properties, timestamps, etc...)-+, module Data.OrgMode.Parse.Attoparsec.PropertyDrawer -- * Parse Body ) where import Data.OrgMode.Parse.Attoparsec.Headings+import Data.OrgMode.Parse.Attoparsec.PropertyDrawer
src/Data/OrgMode/Parse/Internal.hs view
@@ -16,11 +16,15 @@ , Priority (..) , State (..) , Keyword (..)+, PropertyDrawer (..) , toPriority ) where -import Data.Text (Text)+import Data.HashMap.Strict (HashMap)+import Data.Text (Text) +----------------------------------------------------------------------------+ data Heading = Heading { level :: Int , priority :: Maybe Priority@@ -44,3 +48,8 @@ toPriority "B" = B toPriority "C" = C toPriority _ = Unknown++----------------------------------------------------------------------------++newtype PropertyDrawer k v = PropertyDrawer (HashMap k v)+ deriving (Show, Eq)
+ test/Test.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RankNTypes #-}++module Main where++import Headings+import PropertyDrawer+import Test.Tasty++main :: IO ()+main = defaultMain tests++tests :: TestTree+tests = testGroup+ "OrgMode Parser Tests"+ [ parserHeadingTests+ , parserPropertyDrawerTests+ ]