diff --git a/app/Main.hs b/app/Main.hs index 9d1c93c..528f28a 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,9 +1,6 @@ module Main (main) where -import Data.Text.Ubc.Parse - main :: IO () main = do text <- getContents - someFunc return () diff --git a/src/Data/String/Ubc/Parse/Struct.hs b/src/Data/String/Ubc/Parse/Struct.hs index d19e775..da4bb8e 100644 --- a/src/Data/String/Ubc/Parse/Struct.hs +++ b/src/Data/String/Ubc/Parse/Struct.hs @@ -42,8 +42,16 @@ parseStruct = do , getPosition >>= return . Left . StructError.MissingBraceError . Left ] + _ <- structMember `manyTill` (lookAhead $ choice [ eof, UbcLanguage.symbol "}" ]) + closingBrace <- choice [ UbcLanguage.symbol "}" >>= return . Right , getPosition >>= return . Left . StructError.MissingBraceError . Right ] return $ Right $ Struct "" [] + +structMember :: Monad m => ParsecT String ParserState m () +structMember = choice [ structVariableOrFunction ] + +structVariableOrFunction = do + diff --git a/ubcc.cabal b/ubcc.cabal index 7d10b58..98a5eda 100644 --- a/ubcc.cabal +++ b/ubcc.cabal @@ -26,7 +26,14 @@ source-repository head library exposed-modules: Data.String.Ubc.Parse + Data.String.Ubc.Parse.Error.StructError + Data.String.Ubc.Parse.FileScope Data.String.Ubc.Parse.Language + Data.String.Ubc.Parse.ParserState + Data.String.Ubc.Parse.Scope + Data.String.Ubc.Parse.Struct + Data.String.Ubc.Parse.StructScope + Data.String.Ubc.Parse.StructVariable other-modules: Paths_ubcc autogen-modules: