From a33b80dbf64303fe376419216c1245a0238ea37d Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 9 Jan 2023 01:07:25 -0700 Subject: Crude compilation pipeline starting to take shape. This simply does a Stage0 -> Stage1 conversion. Namely, parse the text, check for syntax errors, squeeze the resulting ast and ... that's it. --- src/Language/Fiddle/Parser.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/Language/Fiddle/Parser.hs') diff --git a/src/Language/Fiddle/Parser.hs b/src/Language/Fiddle/Parser.hs index 94fbbf9..c9c3c86 100644 --- a/src/Language/Fiddle/Parser.hs +++ b/src/Language/Fiddle/Parser.hs @@ -60,13 +60,10 @@ fiddleDecl = do t <- tokenType <$> anyToken case t of KWOption -> OptionDecl <$> ident <*> ident - KWPackage -> do - p <- - PackageDecl - <$> ident - <*> defer body packageBody - printNext - return p + KWPackage -> + PackageDecl + <$> ident + <*> defer body packageBody KWLocation -> LocationDecl <$> ident <*> (tok TokEq >> expression) KWBits -> BitsDecl <$> ident <*> (tok TokColon >> bitType) KWObjtype -> @@ -189,7 +186,7 @@ registerBitsTypeRef = do baseTypeRef = withMeta $ (RegisterBitsJustBits <$> exprInParen) - <|> (RegisterBitsAnonymousType <$> anonymousBitsType) + <|> (RegisterBitsAnonymousType <$> anonymousBitsType) <|> (RegisterBitsReference <$> ident) anonymousBitsType :: Pa AnonymousBitsType -- cgit