From 0166b27ee45f24fb60d79498a5d15b4f316191f3 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 27 Feb 2004 07:43:52 +0000 Subject: Started with unions. --- src/GF/Infra/ReadFiles.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/GF/Infra/ReadFiles.hs') diff --git a/src/GF/Infra/ReadFiles.hs b/src/GF/Infra/ReadFiles.hs index 7b95141c7..06205e350 100644 --- a/src/GF/Infra/ReadFiles.hs +++ b/src/GF/Infra/ReadFiles.hs @@ -181,16 +181,21 @@ importsOfFile = getModuleHeader . -- analyse into mod header filter (not . spec) . -- ignore keywords and special symbols unqual . -- take away qualifiers + unrestr . -- take away union restrictions takeWhile (not . term) . -- read until curly or semic lexs . -- analyse into lexical tokens unComm -- ignore comments before the headed line where term = flip elem ["{",";"] - spec = flip elem ["of", "open","in",":", "->","=", "(", ")",",","**"] + spec = flip elem ["of", "open","in",":", "->","=", "(", ")",",","**","union"] unqual ws = case ws of "(":q:ws' -> unqual ws' w:ws' -> w:unqual ws' _ -> ws + unrestr ws = case ws of + "[":ws' -> unrestr $ tail $ dropWhile (/="]") ws' + w:ws' -> w:unrestr ws' + _ -> ws getModuleHeader :: [String] -> ModuleHeader -- with, reuse getModuleHeader ws = case ws of -- cgit v1.2.3