Improve spans for some warnings

This commit is contained in:
Vidar Holen 2018-06-17 19:09:46 -07:00
parent 7138abff4b
commit 868a7be33e
4 changed files with 24 additions and 14 deletions

View file

@ -2682,8 +2682,8 @@ readAssignmentWordExt lenient = try $ do
indices <- many readArrayIndex
hasLeftSpace <- fmap (not . null) spacing
pos <- getPosition
op <- readAssignmentOp
id <- endSpan start
op <- readAssignmentOp
hasRightSpace <- fmap (not . null) spacing
isEndOfCommand <- fmap isJust $ optionMaybe (try . lookAhead $ (void (oneOf "\r\n;&|)") <|> eof))
if not hasLeftSpace && (hasRightSpace || isEndOfCommand)