aboutsummaryrefslogtreecommitdiffstats
path: root/diff-parse.patch
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-14 07:10:03 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-14 07:10:03 +0100
commit11284c7c12c44e12de1cfc712c0391d5ee32a9f2 (patch)
tree553a527ff19f5ef105cbc2f026284e75fa5900db /diff-parse.patch
parentc8ab97e77c8ab56b9835d9f260dc222a10e9b3c6 (diff)
parent09e26c37de7e7227d856ffe15c9554af36b50c58 (diff)
Merge remote-tracking branch 'origin/feature/review'main
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