summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/Parser.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-09 01:07:25 -0700
committerJosh Rahm <joshuarahm@gmail.com>2023-01-09 01:07:25 -0700
commita33b80dbf64303fe376419216c1245a0238ea37d (patch)
tree18477f448abe49d9c384ff0b24d1874eb83afdaa /src/Language/Fiddle/Parser.hs
parentdef481d234ce5e1671d9faaa539477de8cd14640 (diff)
downloadfiddle-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.hs13
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