[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36
John Goerzen
jgoerzen at complete.org
Fri Apr 23 14:47:49 UTC 2010
The following commit has been merged in the master branch:
commit a7b412658a53ce81462015084eb5cd3496bb4596
Author: John Goerzen <jgoerzen at complete.org>
Date: Fri Nov 19 08:40:16 2004 +0100
Cleaned up Parser code
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.5--patch-94)
diff --git a/ChangeLog b/ChangeLog
index bb471a3..e7bf0a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
#
+2004-11-19 01:40:16 GMT John Goerzen <jgoerzen at complete.org> patch-94
+
+ Summary:
+ Cleaned up Parser code
+ Revision:
+ missingh--head--0.5--patch-94
+
+
+ modified files:
+ ChangeLog libsrc/MissingH/ConfigParser/Parser.hs
+
+
2004-11-19 01:36:57 GMT John Goerzen <jgoerzen at complete.org> patch-93
Summary:
diff --git a/libsrc/MissingH/ConfigParser/Parser.hs b/libsrc/MissingH/ConfigParser/Parser.hs
index 918eb8e..c923d68 100644
--- a/libsrc/MissingH/ConfigParser/Parser.hs
+++ b/libsrc/MissingH/ConfigParser/Parser.hs
@@ -110,29 +110,18 @@ sectionhead =
do {s <- tokeng wf; return $ strip s}
optionlist :: GeneralizedTokenParser CPTok () [(String, String)]
-optionlist =
- try (do {c <- coption; ol <- optionlist; return $ c : ol})
- <|> do {c <- coption; return $ [c]}
-
-extensionlist :: GeneralizedTokenParser CPTok () [String]
-extensionlist =
- let wf (EXTENSIONLINE x) = Just x
- wf _ = Nothing
- in
- try (do {x <- tokeng wf; l <- extensionlist; return $ x : l})
- <|> do {x <- tokeng wf; return [x]}
+optionlist = many1 coption
coption :: GeneralizedTokenParser CPTok () (String, String)
coption =
let wf (NEWOPTION x) = Just x
wf _ = Nothing
+ wfx (EXTENSIONLINE x) = Just x
+ wfx _ = Nothing
in
- try (do
- o <- tokeng wf
- l <- extensionlist
- return (strip (fst o), valmerge ((snd o) : l ))
- )
- <|> do {o <- tokeng wf; return $ (strip (fst o), strip (snd o))}
+ do o <- tokeng wf
+ l <- many $ tokeng wfx
+ return (strip (fst o), valmerge ((snd o) : l))
valmerge :: [String] -> String
valmerge vallist =
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list