Struct parsing continued
This commit is contained in:
parent
d1d9846a99
commit
0adef12173
3 changed files with 15 additions and 3 deletions
|
@ -1,9 +1,6 @@
|
|||
module Main (main) where
|
||||
|
||||
import Data.Text.Ubc.Parse
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
text <- getContents
|
||||
someFunc
|
||||
return ()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue