parseDTFLine :: [DictElem] -> Parser DTF
parseDTFLine dict = foldl1 (<|>) (fmap (\x -> try (x dict)) lineFormats) <* char '\n'
-lineFormats = [lf_define, lf_sdata, lf_stext, lf_org, lf_data, lf_comment, lf_toparse, lf_label]
+lineFormats = [lf_define, lf_sdata, lf_stext, lf_org, lf_data, lf_ifill, lf_comment, lf_toparse, lf_label]
-- helper
parseIdent :: Parser String
comment <- try(parseComment) <|> parseMySpaces
return $ DTF_Fill r val (fill ++ (if repeat == "1" then "" else repeat) ++ code) l comment
+lf_ifill d = do
+ l <- try (parseLabel) <|> string ""
+ skipMany space
+ fill <- string ".ifill "
+ code <- many1 $ noneOf "\n;"
+ let val = case parse (instruction (0,d)) "" (code++"\n") of
+ Right v -> v
+ Left err -> error $ show err
+ comment <- try(parseComment) <|> parseMySpaces
+ return $ DTF_Fill 1 val (fill ++ code) l comment
+
lf_comment _ = do
comment <- parseComment
return $ DTF_Comment comment