Allow tests to access token positions for fixes

This commit is contained in:
Vidar Holen 2018-12-16 13:05:19 -08:00
parent b47e083ee3
commit 5b3f17c29d
2 changed files with 22 additions and 19 deletions

View file

@ -199,8 +199,9 @@ checkUnqualifiedCommand _ _ _ = return ()
checkNode f = producesComments (runNodeAnalysis f)
producesComments :: (Parameters -> Token -> [TokenComment]) -> String -> Maybe Bool
producesComments f s = do
root <- pScript s
return . not . null $ runList (defaultSpec root) [f]
let pr = pScript s
prRoot pr
return . not . null $ runList (defaultSpec pr) [f]
-- Copied from https://wiki.haskell.org/Edit_distance
dist :: Eq a => [a] -> [a] -> Int