From: Ian Lynagh Date: Sat, 3 May 2008 23:45:39 +0000 (+0000) Subject: Tiny code recatoring in GhciTags X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=cea34a8aab0d8d47f48ed8797ac6ac4f3964346c Tiny code recatoring in GhciTags --- diff --git a/compiler/ghci/GhciTags.hs b/compiler/ghci/GhciTags.hs index 6aa4829..9959991 100644 --- a/compiler/ghci/GhciTags.hs +++ b/compiler/ghci/GhciTags.hs @@ -120,12 +120,9 @@ collateAndWriteTags ETags file tagInfos = do -- etags style, Emacs/XEmacs sortedGroup = sortLe byLine group tags = unlines $ perFile sortedGroup 1 0 $ lines file return $ "\x0c\n" ++ fileName ++ "," ++ show (length tags) ++ "\n" ++ tags - perFile (tagInfo@(_tag, _file, lNo, _colNo):tags) count pos (line:lines) - | lNo > count = - perFile (tagInfo:tags) (count+1) (pos+length line) lines - perFile (tagInfo@(_tag, _file, lNo, _colNo):tags) count pos lines@(line:_) - | lNo == count = - showETag tagInfo line pos : perFile tags count pos lines + perFile (tagInfo@(_tag, _file, lNo, _colNo):tags) count pos lines@(line:lines') + | lNo > count = perFile (tagInfo:tags) (count+1) (pos+length line) lines' + | lNo == count = showETag tagInfo line pos : perFile tags count pos lines perFile _ _ _ _ = [] -- simple ctags format, for Vim et al