From afc6933f643f1bebe86b846768bd80df2b8e1ab1 Mon Sep 17 00:00:00 2001 From: Jake Wheat Date: Fri, 13 Dec 2013 16:04:48 +0200 Subject: [PATCH] put the modules in a better path --- Parser.lhs => Language/SQL/SimpleSQL/Parser.lhs | 9 +++++---- Pretty.lhs => Language/SQL/SimpleSQL/Pretty.lhs | 7 +++++-- Syntax.lhs => Language/SQL/SimpleSQL/Syntax.lhs | 15 ++++++++------- Tests.lhs | 6 +++--- simple-sql-parser.cabal | 6 ++++-- 5 files changed, 25 insertions(+), 18 deletions(-) rename Parser.lhs => Language/SQL/SimpleSQL/Parser.lhs (98%) rename Pretty.lhs => Language/SQL/SimpleSQL/Pretty.lhs (96%) rename Syntax.lhs => Language/SQL/SimpleSQL/Syntax.lhs (88%) diff --git a/Parser.lhs b/Language/SQL/SimpleSQL/Parser.lhs similarity index 98% rename from Parser.lhs rename to Language/SQL/SimpleSQL/Parser.lhs index 294644d..4608374 100644 --- a/Parser.lhs +++ b/Language/SQL/SimpleSQL/Parser.lhs @@ -1,8 +1,9 @@ -> module Parser (parseQueryExpr -> ,parseScalarExpr -> ,ParseError) where +> module Language.SQL.SimpleSQL.Parser +> (parseQueryExpr +> ,parseScalarExpr +> ,ParseError) where > import Text.Groom > import Text.Parsec @@ -12,7 +13,7 @@ > import qualified Language.Haskell.Exts.Fixity as HSE > import Data.Maybe -> import Syntax +> import Language.SQL.SimpleSQL.Syntax > parseQueryExpr :: FilePath -> Maybe (Int,Int) -> String -> Either ParseError QueryExpr diff --git a/Pretty.lhs b/Language/SQL/SimpleSQL/Pretty.lhs similarity index 96% rename from Pretty.lhs rename to Language/SQL/SimpleSQL/Pretty.lhs index 3838072..d63da55 100644 --- a/Pretty.lhs +++ b/Language/SQL/SimpleSQL/Pretty.lhs @@ -2,9 +2,12 @@ This is the pretty printer code which takes AST values and turns them back into SQL source text. It attempts to format the output nicely. -> module Pretty (prettyQueryExpr, prettyScalarExpr) where +> module Language.SQL.SimpleSQL.Pretty +> (prettyQueryExpr +> ,prettyScalarExpr +> ) where -> import Syntax +> import Language.SQL.SimpleSQL.Syntax > import Text.PrettyPrint > import Data.Maybe diff --git a/Syntax.lhs b/Language/SQL/SimpleSQL/Syntax.lhs similarity index 88% rename from Syntax.lhs rename to Language/SQL/SimpleSQL/Syntax.lhs index 1db345d..43958e8 100644 --- a/Syntax.lhs +++ b/Language/SQL/SimpleSQL/Syntax.lhs @@ -1,11 +1,12 @@ -> module Syntax (QueryExpr(..) -> ,makeSelect -> ,ScalarExpr(..) -> ,TableRef(..) -> ,JoinType(..) -> ,JoinCondition(..)) -> where +> module Language.SQL.SimpleSQL.Syntax +> (QueryExpr(..) +> ,makeSelect +> ,ScalarExpr(..) +> ,TableRef(..) +> ,JoinType(..) +> ,JoinCondition(..) +> ) where > data ScalarExpr = Literal String diff --git a/Tests.lhs b/Tests.lhs index 57529e4..7b77247 100644 --- a/Tests.lhs +++ b/Tests.lhs @@ -1,9 +1,9 @@ > module Tests (testData, runTests) where -> import Syntax -> import Pretty -> import Parser +> import Language.SQL.SimpleSQL.Syntax +> import Language.SQL.SimpleSQL.Pretty +> import Language.SQL.SimpleSQL.Parser > import qualified Test.HUnit as H > import Control.Monad diff --git a/simple-sql-parser.cabal b/simple-sql-parser.cabal index f311d3c..f1208af 100644 --- a/simple-sql-parser.cabal +++ b/simple-sql-parser.cabal @@ -2,7 +2,7 @@ name: simple-sql-parser version: 0.1.0.0 synopsis: A parser for SQL queries -description: A parser for SQL queries, using Parsec. Also includes pretty printer. Aims to support most of SQL2003 queries. +description: A parser for SQL queries, using Parsec. Also includes pretty printer. Aims to support most of SQL2003 queries plus other dialects. homepage: https://github.com/JakeWheat/simple_sql_parser license: BSD3 @@ -21,7 +21,9 @@ source-repository head location: https://github.com/JakeWheat/simple_sql_parser.git library - exposed-modules: Pretty, Parser, Syntax + exposed-modules: Language.SQL.SimpleSQL.Pretty, + Language.SQL.SimpleSQL.Parser, + Language.SQL.SimpleSQL.Syntax -- other-modules: -- other-extensions: build-depends: base >=4.6 && <4.7,