sim: support "--" as comment

Using this in my sim files that are also mdwn files to avoid comments
being displayed as headers.
This commit is contained in:
Joey Hess 2024-09-25 14:47:32 -04:00
parent dc6c0f0f1f
commit 6a95e4edad
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 24 additions and 22 deletions

View file

@ -27,7 +27,8 @@ parseSimFile = go [] . lines
parseSimFileLine :: String -> Either String SimCommand
parseSimFileLine s
| "#" `isPrefixOf` s = Right (CommandComment s)
| "#" `isPrefixOf` s || "--" `isPrefixOf` s =
Right (CommandComment s)
| all isSpace s = Right (CommandBlank)
| otherwise = parseSimCommand (words s)