summaryrefslogtreecommitdiff
path: root/DSL/Parsing.hs
diff options
context:
space:
mode:
Diffstat (limited to 'DSL/Parsing.hs')
-rw-r--r--DSL/Parsing.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/DSL/Parsing.hs b/DSL/Parsing.hs
index 72d6b23..d4d1253 100644
--- a/DSL/Parsing.hs
+++ b/DSL/Parsing.hs
@@ -191,16 +191,8 @@ blockP = firstOf [ whileP
, linearP
]
-programP :: DSLParser ([ProcSpec], Program)
-programP = phrase $ procs `plus` code
+stringToProgram :: String -> Maybe ProcTable
+stringToProgram = (>>=buildProcTable . snd) . parse (tokenizer `chain` program)
where
- procs = mult procP
- code = mult1 blockP
-
-stringToProgram :: String -> Maybe (ProcTable, Program)
-stringToProgram = (>>=(f . snd)) . parse (tokenizer `chain` programP)
- where
- f (ps, b) = case buildProcTable ps of
- Nothing -> Nothing
- Just t -> Just (t, b)
+ program = phrase $ mult procP