Handle function prototypes prefixed with a single macro token.

This commit is contained in:
Erik Svedäng 2018-02-27 13:09:21 +01:00
parent ebbdf95679
commit 4f86ae7907

View File

@ -32,7 +32,14 @@ parseHeaderFile path src =
cSyntax = Parsec.sepBy line (Parsec.char '\n')
line :: Parsec.Parsec String () [XObj]
line = Parsec.try functionPrototype <|> discarded
line = Parsec.try prefixedFunctionPrototype <|>
Parsec.try functionPrototype <|>
discarded
prefixedFunctionPrototype :: Parsec.Parsec String () [XObj]
prefixedFunctionPrototype = do Parsec.many spaceOrTab
_ <- Parsec.many1 identifierChar
functionPrototype
functionPrototype :: Parsec.Parsec String () [XObj]
functionPrototype = do Parsec.many spaceOrTab