Skip to content

Commit

Permalink
Replace LineDirective with more general Skipping in Rope
Browse files Browse the repository at this point in the history
  • Loading branch information
sopvop committed Mar 14, 2013
1 parent afe03e8 commit 1ad1615
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Text/Trifecta/Rope.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,21 @@ import Data.FingerTree as FingerTree
import GHC.Generics
import Data.Foldable (toList)
import Data.Hashable
import Data.Int (Int64)
import Text.Trifecta.Util.Combinators as Util
import Text.Trifecta.Delta
import Data.Data

data Strand
= Strand {-# UNPACK #-} !ByteString !Delta
| LineDirective {-# UNPACK #-} !ByteString {-# UNPACK #-} !Int64
| Skipping !Delta
deriving (Show, Data, Typeable, Generic)

strand :: ByteString -> Strand
strand bs = Strand bs (delta bs)

instance Measured Delta Strand where
measure (Strand _ s) = delta s
measure (LineDirective p l) = delta (Directed p l 0 0 0)
measure (Skipping d) = d

instance Hashable Strand

Expand Down
2 changes: 1 addition & 1 deletion trifecta.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: trifecta
category: Text, Parsing, Diagnostics, Pretty Printer, Logging
version: 1.0
version: 1.1
license: BSD3
cabal-version: >= 1.10
license-file: LICENSE
Expand Down

0 comments on commit 1ad1615

Please sign in to comment.