From c39c7eb0fa82cececf286b48d5215f8f892c4d41 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 29 Jul 2022 03:28:50 -0400 Subject: Parse sysdeps for C code --- Biz/Bild.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Biz/Bild.hs') diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 270508f..602a326 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -349,8 +349,13 @@ analyze path = do Namespace.C -> do pure Target - { langdeps = Set.empty, - sysdeps = Set.empty, + { langdeps = Set.empty, -- c has no lang deps...? + sysdeps = + contentLines + /> Text.unpack + /> Regex.match (metaSys "//") + |> catMaybes + |> Set.fromList, compiler = Gcc, out = contentLines @@ -664,7 +669,7 @@ metaDep :: Regex.RE Char Dep metaDep = Regex.string "-- : dep " *> Regex.many (Regex.psym Char.isAlpha) metaSys :: [Char] -> Regex.RE Char Dep -metaSys comment = Regex.string (comment ++ " : sys ") *> Regex.many (Regex.psym Char.isAlpha) +metaSys comment = Regex.string (comment ++ " : sys ") *> Regex.many (Regex.psym (not <. Char.isSpace)) metaOut :: [Char] -> Regex.RE Char Out metaOut comment = Regex.string (comment ++ " : out ") *> Regex.many (Regex.psym (/= ' ')) -- cgit v1.2.3