Permalink
Browse files

Solve error on parenthesized variables (try to solve issue #21)

  • Loading branch information...
1 parent 6801ade commit 896a1886c0b7660fc21129efe1a79f1cdf0c9e44 @serras committed Feb 4, 2012
Showing with 10 additions and 12 deletions.
  1. +6 −9 src/Main.hs
  2. +3 −2 src/Scion/PersistentBrowser/Parser/Internal.hs
  3. +1 −1 src/Scion/PersistentBrowser/ToDb.hs
View
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
module Main where
@@ -21,14 +21,11 @@ import Scion.PersistentBrowser.Util (logToStdout)
import GHC.IO.Handle (hDuplicate,hDuplicateTo)
main :: IO ()
-main = do
- args<-getArgs
- case args of
- ("--version":_)->do
- putStrLn ("scion-browser executable, version "++ (showVersion version))
- _-> do
- runStateT (runInputT defaultSettings loop) initialState
- return ()
+main = do args <- getArgs
+ case args of
+ ("--version":_) -> putStrLn ("scion-browser executable, version " ++ (showVersion version))
+ _ -> do runStateT (runInputT defaultSettings loop) initialState
+ return ()
loop :: InputT BrowserM ()
loop = do maybeLine <- getInputLine ""
@@ -539,6 +539,7 @@ toKindedVars :: [Type Doc] -> [TyVarBind Doc]
toKindedVars [] = []
toKindedVars ((TyVar d (Ident _ n1)):( (TyList _ (TyVar _ (Ident _ n2))): xs )) =
(UnkindedVar d (Ident NoDoc $ n1 ++ "[" ++ n2 ++ "]")) : toKindedVars xs
-toKindedVars ((TyVar d n):xs) = (UnkindedVar d n) : toKindedVars xs
-toKindedVars (x:_) = error $ show x
+toKindedVars ((TyVar d n):xs) = (UnkindedVar d n) : toKindedVars xs
+toKindedVars ((TyParen _ inner):xs) = toKindedVars (inner:xs)
+toKindedVars (x:_) = error $ show x
@@ -60,7 +60,7 @@ saveDeclToDb moduleId (InstDecl doc ctx hd _) =
-- Signatures
saveDeclToDb moduleId (TypeSig doc names ty) =
do mapM_ saveSignatureToDb names
- where saveSignatureToDb name =
+ where saveSignatureToDb name = do
insert $ DbDecl DbSignature (getNameString name) (docToString doc)
Nothing (Just (singleLinePrettyPrint ty)) Nothing moduleId
-- Types

0 comments on commit 896a188

Please sign in to comment.