Skip to content

Commit

Permalink
Merge pull request #146 from EpitechPromo2027/145-top-level-typedef-m…
Browse files Browse the repository at this point in the history
…akes-the-project-have-no-globals

add: space consumer at start of `Program`
  • Loading branch information
oriollinan authored Jan 11, 2025
2 parents 3899c43 + d0e7171 commit 1445caf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Ast/Parser/Program.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import qualified Text.Megaparsec as M

parseProgram :: String -> PU.Parser AT.Program
parseProgram sourceFile = do
_ <- PU.sc
types <- M.many $ M.try $ PU.lexeme PT.parseTypeDefinition
exprs <- M.many PE.parseExpr
return $ AT.Program {AT.globals = map globalExpr exprs, AT.types = map globalType types, AT.sourceFile = sourceFile}
Expand Down

0 comments on commit 1445caf

Please # to comment.