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
|
module Main (main) where
|
||||||
|
|
||||||
import Data.Text.Ubc.Parse
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
text <- getContents
|
text <- getContents
|
||||||
someFunc
|
|
||||||
return ()
|
return ()
|
||||||
|
|
|
@ -42,8 +42,16 @@ parseStruct = do
|
||||||
, getPosition >>= return . Left . StructError.MissingBraceError . Left
|
, getPosition >>= return . Left . StructError.MissingBraceError . Left
|
||||||
]
|
]
|
||||||
|
|
||||||
|
_ <- structMember `manyTill` (lookAhead $ choice [ eof, UbcLanguage.symbol "}" ])
|
||||||
|
|
||||||
closingBrace <- choice
|
closingBrace <- choice
|
||||||
[ UbcLanguage.symbol "}" >>= return . Right
|
[ UbcLanguage.symbol "}" >>= return . Right
|
||||||
, getPosition >>= return . Left . StructError.MissingBraceError . Right
|
, getPosition >>= return . Left . StructError.MissingBraceError . Right
|
||||||
]
|
]
|
||||||
return $ Right $ Struct "" []
|
return $ Right $ Struct "" []
|
||||||
|
|
||||||
|
structMember :: Monad m => ParsecT String ParserState m ()
|
||||||
|
structMember = choice [ structVariableOrFunction ]
|
||||||
|
|
||||||
|
structVariableOrFunction = do
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,14 @@ source-repository head
|
||||||
library
|
library
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
Data.String.Ubc.Parse
|
Data.String.Ubc.Parse
|
||||||
|
Data.String.Ubc.Parse.Error.StructError
|
||||||
|
Data.String.Ubc.Parse.FileScope
|
||||||
Data.String.Ubc.Parse.Language
|
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:
|
other-modules:
|
||||||
Paths_ubcc
|
Paths_ubcc
|
||||||
autogen-modules:
|
autogen-modules:
|
||||||
|
|
Loading…
Reference in a new issue