Add a comment and asmToken parser

This commit is contained in:
I-Al-Istannen 2020-03-31 15:04:12 +02:00
parent 7c02901b64
commit a540e1711a

View file

@ -342,6 +342,16 @@ directive =
pure $ f outerSpan regSpan metaName jsonValue pure $ f outerSpan regSpan metaName jsonValue
comment :: Parser T.Text
comment = char ';' *> takeWhileP (Just "comment") (/= '\n')
asmToken :: Parser (AsmToken Span)
asmToken
= (TokenLabel <$> name) <|>
(TokenInstruction <$> instruction) <|>
(TokenDirective <$> directive) <|>
fmap (uncurry TokenComment) (withSpan comment)
parsePhase1 :: Parser Phase1 parsePhase1 :: Parser Phase1
parsePhase1 = undefined parsePhase1 = undefined