diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-21 10:06:11 -0500 |
---|---|---|
committer | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-21 10:06:11 -0500 |
commit | bcef4a4789f439934a40709189c1ae9e036cf1d2 (patch) | |
tree | 575ca9822bf5c40ea6616d1912b33b340d6f66d6 /bootstrap/src/BuildModel.hs | |
parent | 1830d3e9bedb9da860de9682b43696fd6172f34f (diff) | |
download | fpm-bcef4a4789f439934a40709189c1ae9e036cf1d2.tar.gz fpm-bcef4a4789f439934a40709189c1ae9e036cf1d2.zip |
Make module subprogram declaration detection more explicit/restricted
Diffstat (limited to 'bootstrap/src/BuildModel.hs')
-rw-r--r-- | bootstrap/src/BuildModel.hs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs index 8f4d813..6dc8ddf 100644 --- a/bootstrap/src/BuildModel.hs +++ b/bootstrap/src/BuildModel.hs @@ -308,14 +308,24 @@ useStatement = do moduleSubprogramDeclaration :: ReadP LineContents moduleSubprogramDeclaration = do - skipAnything + skipSpaces + skipProcedureQualifiers _ <- string "module" skipAtLeastOneWhiteSpace - skipAnything _ <- string "function" <|> string "subroutine" skipAtLeastOneWhiteSpace return $ ModuleSubprogramDeclaration +skipProcedureQualifiers :: ReadP () +skipProcedureQualifiers = do + many skipPossibleQualifier + return () + +skipPossibleQualifier :: ReadP () +skipPossibleQualifier = do + _ <- string "pure" <|> string "elemental" <|> string "impure" + skipAtLeastOneWhiteSpace + skipAtLeastOneWhiteSpace :: ReadP () skipAtLeastOneWhiteSpace = do _ <- many1 whiteSpace |