[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:26 UTC 2010


The following commit has been merged in the master branch:
commit 24e8c617cc76d229c91ee60838082b492c67afd1
Author: John Goerzen <jgoerzen at complete.org>
Date:   Fri Nov 19 00:26:26 2004 +0100

    Removed need for RunParser.hs
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-75)

diff --git a/ChangeLog b/ChangeLog
index 63f3678..605a52a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,27 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-18 17:26:26 GMT	John Goerzen <jgoerzen at complete.org>	patch-75
+
+    Summary:
+      Removed need for RunParser.hs
+    Revision:
+      missingh--head--0.5--patch-75
+
+
+    removed files:
+     libsrc/MissingH/ConfigParser/RunParser.hs
+
+    modified files:
+     ChangeLog libsrc/MissingH/ConfigParser/Lexer.hs
+     libsrc/MissingH/ConfigParser/Parser.hs
+     testsrc/ConfigParser/Parsertest.hs testsrc/Tests.hs
+
+    renamed files:
+     testsrc/ConfigParser/RunParsertest.hs
+       ==> testsrc/ConfigParser/Parsertest.hs
+
+
 2004-11-18 17:17:15 GMT	John Goerzen <jgoerzen at complete.org>	patch-74
 
     Summary:
diff --git a/libsrc/MissingH/ConfigParser/Lexer.hs b/libsrc/MissingH/ConfigParser/Lexer.hs
index e4975ac..cd2b531 100644
--- a/libsrc/MissingH/ConfigParser/Lexer.hs
+++ b/libsrc/MissingH/ConfigParser/Lexer.hs
@@ -37,12 +37,19 @@ module MissingH.ConfigParser.Lexer
        --comment_chars, eol, optionsep, whitespace_chars, comment_line,
        --empty_line, sectheader_chars, sectheader, oname_chars, value_chars,
        --extension_line, optionkey, optionvalue, optionpair
-       loken
+       loken,
+       CPTok(..)
 ) where
 
 import Text.ParserCombinators.Parsec
 import MissingH.Parsec
-import MissingH.ConfigParser.Parser
+
+data CPTok = EOFTOK
+           | NEWSECTION String
+           | NEWSECTION_EOF String
+           | EXTENSIONLINE String
+           | NEWOPTION (String, String)
+             deriving (Eq, Show, Ord)
 
 comment_chars = oneOf "#;"
 eol = string "\n" <|> string "\r\n" <|> string "\r" <?> "End of line"
diff --git a/libsrc/MissingH/ConfigParser/Parser.hs b/libsrc/MissingH/ConfigParser/Parser.hs
index 10bbc04..7a8dfdd 100644
--- a/libsrc/MissingH/ConfigParser/Parser.hs
+++ b/libsrc/MissingH/ConfigParser/Parser.hs
@@ -33,19 +33,33 @@ Copyright (c) 2004 John Goerzen, jgoerzen\@complete.org
 -}
 module MissingH.ConfigParser.Parser
 (
-       CPTok(..),
-       satisfyG,
-       main
+ parse_string,
+       --satisfyG,
+       --main
 ) where
 import Text.ParserCombinators.Parsec
 import MissingH.Str
-
-data CPTok = EOFTOK
-           | NEWSECTION String
-           | NEWSECTION_EOF String
-           | EXTENSIONLINE String
-           | NEWOPTION (String, String)
-             deriving (Eq, Show, Ord)
+import MissingH.ConfigParser.Lexer
+
+----------------------------------------------------------------------
+-- Exported funcs
+----------------------------------------------------------------------
+
+parse_string :: String -> [(String, [(String, String)])]
+parse_string s = 
+    detokenize "(string)" $ parse loken "(string)" s
+
+----------------------------------------------------------------------
+-- Private funcs
+----------------------------------------------------------------------
+detokenize fp l =
+    let r = case l of
+                   Left err -> error (show err)
+                   Right reply -> reply
+        in
+        case runParser main () fp r of
+                                    Left err -> error (show err)
+                                    Right reply -> reply
 
 main :: GenParser CPTok () [(String, [(String, String)])]
 main =
diff --git a/libsrc/MissingH/ConfigParser/RunParser.hs b/libsrc/MissingH/ConfigParser/RunParser.hs
deleted file mode 100644
index f132703..0000000
--- a/libsrc/MissingH/ConfigParser/RunParser.hs
+++ /dev/null
@@ -1,55 +0,0 @@
-{- arch-tag: ConfigParser parser running utilities
-Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
--}
-
-{- |
-   Module     : MissingH.ConfigParser.RunParser
-   Copyright  : Copyright (C) 2004 John Goerzen
-   License    : GNU GPL, version 2 or above
-
-   Maintainer : John Goerzen, 
-   Maintainer : jgoerzen at complete.org
-   Stability  : provisional
-   Portability: portable
-
-Parser support for "MissingH.ConfigParser".  This module is not intended to be
-used directly by your programs.
-
-Copyright (c) 2004 John Goerzen, jgoerzen\@complete.org
--}
-
-module MissingH.ConfigParser.RunParser(
-                                       parse_string
-                                      )
-where
-
-import Text.ParserCombinators.Parsec
-import MissingH.ConfigParser.Parser
-import MissingH.ConfigParser.Lexer
-
-detokenize fp l =
-    let r = case l of
-                   Left err -> error (show err)
-                   Right reply -> reply
-        in
-        case runParser main () fp r of
-                                    Left err -> error (show err)
-                                    Right reply -> reply
-
-parse_string :: String -> [(String, [(String, String)])]
-parse_string s = 
-    detokenize "(string)" $ parse loken "(string)" s
\ No newline at end of file
diff --git a/testsrc/ConfigParser/RunParsertest.hs b/testsrc/ConfigParser/Parsertest.hs
similarity index 90%
rename from testsrc/ConfigParser/RunParsertest.hs
rename to testsrc/ConfigParser/Parsertest.hs
index 50691ed..a3c9cc5 100644
--- a/testsrc/ConfigParser/RunParsertest.hs
+++ b/testsrc/ConfigParser/Parsertest.hs
@@ -16,9 +16,9 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
-module ConfigParser.RunParsertest(tests) where
+module ConfigParser.Parsertest(tests) where
 import HUnit
-import MissingH.ConfigParser.RunParser
+import MissingH.ConfigParser.Parser
 import Testutil
 
 test_basic =
diff --git a/testsrc/Tests.hs b/testsrc/Tests.hs
index 693c9ad..78f66ac 100644
--- a/testsrc/Tests.hs
+++ b/testsrc/Tests.hs
@@ -27,7 +27,7 @@ import qualified IOtest
 import qualified Bitstest
 import qualified Printftest
 import qualified Network.FTP.Parsertest
-import qualified ConfigParser.RunParsertest
+import qualified ConfigParser.Parsertest
 
 test1 = TestCase ("x" @=? "x")
 
@@ -40,6 +40,6 @@ tests = TestList [TestLabel "test1" test1,
                  TestLabel "Bitstest" Bitstest.tests,
                  TestLabel "Network.FTP.Parser" Network.FTP.Parsertest.tests,
                  TestLabel "Printftest" Printftest.tests,
-                 TestLabel "ConfigParser.RunParser" ConfigParser.RunParsertest.tests]
+                 TestLabel "ConfigParser.RunParser" ConfigParser.Parsertest.tests]
 
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list