From 0c459ae2cb42be1d5bd8b8f883e04a75dbd5e9ce Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Thu, 7 Jun 2018 21:32:49 -0700 Subject: [PATCH] Add function to set end pos of start id --- src/ShellCheck/Parser.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ShellCheck/Parser.hs b/src/ShellCheck/Parser.hs index c7224f4..a11af7a 100644 --- a/src/ShellCheck/Parser.hs +++ b/src/ShellCheck/Parser.hs @@ -188,6 +188,16 @@ getNextId = do pos <- getPosition getNextIdAt pos +endPosOfStartId s = do + endPos <- getPosition + state <- getState + let setEndPos (start, _) = Just (start, Just endPos) + let newMap = Map.update setEndPos s (positionMap state) + putState $ state { + lastId = s, + positionMap = newMap + } + addToHereDocMap id list = do state <- getState let map = hereDocMap state