Initial work on refining variable

This commit is contained in:
Alejandro Serrano
2014-07-16 18:20:52 +02:00
parent 72679c619c
commit 49437d82d9
5 changed files with 67 additions and 0 deletions

View File

@@ -146,6 +146,7 @@ loop opt set mvar = do
"type" -> showType set arg
"split" -> doSplit set arg
"sig" -> doSig set arg
"refine" -> doRefine set arg
"boot" -> bootIt set
"browse" -> browseIt set arg
"quit" -> return ("quit", False, set)
@@ -273,6 +274,15 @@ doSig set fileArg = do
ret <- sig file (read line) (read column)
return (ret, True, set')
doRefine :: Set FilePath
-> FilePath
-> GhcMod (String, Bool, Set FilePath)
doRefine set fileArg = do
let [file, line, column, expr] = words fileArg
set' <- newFileSet set file
ret <- rewrite file (read line) (read column) expr
return (ret, True, set')
----------------------------------------------------------------
bootIt :: Set FilePath