aboutsummaryrefslogtreecommitdiffstats
path: root/diff-parse.patch
diff options
context:
space:
mode:
Diffstat (limited to 'diff-parse.patch')
-rw-r--r--diff-parse.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/diff-parse.patch b/diff-parse.patch
new file mode 100644
index 0000000..d3fac03
--- /dev/null
+++ b/diff-parse.patch
@@ -0,0 +1,39 @@
+diff --git a/src/Text/Diff/Parse/Internal.hs b/src/Text/Diff/Parse/Internal.hs
+index 99302b8..715686c 100644
+--- a/src/Text/Diff/Parse/Internal.hs
++++ b/src/Text/Diff/Parse/Internal.hs
+@@ -50,12 +50,12 @@ fileDelta = do
+ fileDeltaHeader :: Parser (FileStatus, Text, Text)
+ fileDeltaHeader = do
+ _ <- string "diff --git "
+- source <- path <* space
+- dest <- path <* endOfLine
++ _ <- path <* space
++ _ <- path <* endOfLine
+ status <- fileStatus
+ _ <- option "" (string "index" >> takeLine)
+- _ <- option "" (string "--- " >> takeLine)
+- _ <- option "" (string "+++ " >> takeLine)
++ source <- string "--- " >> path <* endOfLine
++ dest <- string "+++ " >> path <* endOfLine
+ return $ (status, source, dest)
+
+ takeLine :: Parser Text
+@@ -97,3 +97,4 @@ annotation :: Parser Annotation
+ annotation = (char '+' >> return Added)
+ <|> (char '-' >> return Removed)
+ <|> (char ' ' >> return Context)
++ <|> (char '#' >> return Comment)
+diff --git a/src/Text/Diff/Parse/Types.hs b/src/Text/Diff/Parse/Types.hs
+index a658ae4..3901575 100644
+--- a/src/Text/Diff/Parse/Types.hs
++++ b/src/Text/Diff/Parse/Types.hs
+@@ -2,7 +2,7 @@ module Text.Diff.Parse.Types where
+
+ import Data.Text (Text)
+
+-data Annotation = Added | Removed | Context deriving (Show, Eq)
++data Annotation = Added | Removed | Context | Comment deriving (Show, Eq)
+
+ data Line = Line {
+ lineAnnotation :: Annotation