Change definition of Replacement, add ToJSON instance for it

This commit is contained in:
Ng Zhi An 2018-10-20 23:20:30 -07:00 committed by Vidar Holen
parent 4a87d2a3de
commit 5ed89d2241
4 changed files with 48 additions and 16 deletions

View file

@ -50,7 +50,8 @@ module ShellCheck.Interface
, newPositionedComment
, newComment
, Fix
, Replacement(R)
, Replacement(repStartPos, repEndPos, repString)
, newReplacement
) where
import ShellCheck.AST
@ -196,9 +197,17 @@ newComment = Comment {
}
-- only support single line for now
data Replacement =
R Position Position String
deriving (Show, Eq)
data Replacement = Replacement {
repStartPos :: Position,
repEndPos :: Position,
repString :: String
} deriving (Show, Eq)
newReplacement = Replacement {
repStartPos = newPosition,
repEndPos = newPosition,
repString = ""
}
type Fix = [Replacement]