Struct parsing continued

This commit is contained in:
VegOwOtenks 2025-01-01 21:02:06 +01:00
parent d1d9846a99
commit 0adef12173
3 changed files with 15 additions and 3 deletions

View file

@ -1,9 +1,6 @@
module Main (main) where
import Data.Text.Ubc.Parse
main :: IO ()
main = do
text <- getContents
someFunc
return ()

View file

@ -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

View file

@ -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: