diff options
author | Marvin Borner | 2023-02-23 15:55:33 +0100 |
---|---|---|
committer | Marvin Borner | 2023-02-23 15:55:33 +0100 |
commit | 078734c1a310300c8121022103f1b4ca9bd1b5f2 (patch) | |
tree | b7ab2cefb2261d4e79b6b2b4d86b5f9777682381 /src/Parser.hs | |
parent | f452a6f311408ea78e5fce765766c98acca33188 (diff) |
Added watch command
Diffstat (limited to 'src/Parser.hs')
-rw-r--r-- | src/Parser.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Parser.hs b/src/Parser.hs index b572f9a..b82a266 100644 --- a/src/Parser.hs +++ b/src/Parser.hs @@ -289,6 +289,12 @@ parseInput = do path <- importPath pure $ Input $ path ++ ".bruijn" +parseWatch :: Parser Command +parseWatch = do + _ <- string ":watch" <* sc <?> "watch instruction" + path <- importPath + pure $ Watch $ path ++ ".bruijn" + parseTest :: Parser Command parseTest = do _ <- string ":test" <* sc <?> "test" @@ -328,6 +334,7 @@ parseReplLine = try parseReplDefine -- TODO: This is kinda hacky <|> ((Commands . (: [])) <$> try parseTest) <|> ((Commands . (: [])) <$> try parseInput) + <|> ((Commands . (: [])) <$> try parseWatch) <|> ((Commands . (: [])) <$> try parseImport) <|> ((Commands . (: [])) <$> try parseTime) <|> ((Commands . (: [])) <$> try parseClearState) |