diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-09 01:07:25 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-09 01:07:25 -0700 |
commit | a33b80dbf64303fe376419216c1245a0238ea37d (patch) | |
tree | 18477f448abe49d9c384ff0b24d1874eb83afdaa /src/Language/Fiddle/Parser.hs | |
parent | def481d234ce5e1671d9faaa539477de8cd14640 (diff) | |
download | fiddle-a33b80dbf64303fe376419216c1245a0238ea37d.tar.gz fiddle-a33b80dbf64303fe376419216c1245a0238ea37d.tar.bz2 fiddle-a33b80dbf64303fe376419216c1245a0238ea37d.zip |
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.
Diffstat (limited to 'src/Language/Fiddle/Parser.hs')
-rw-r--r-- | src/Language/Fiddle/Parser.hs | 13 |
1 files changed, 5 insertions, 8 deletions
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 |