From 3848788c2d277b1fc24b39fab0551f038d234976 Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Thu, 7 Jun 2018 21:52:29 -0700 Subject: [PATCH] Add end pos to readDollarVariable --- src/ShellCheck/Parser.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ShellCheck/Parser.hs b/src/ShellCheck/Parser.hs index a11af7a..2d5290b 100644 --- a/src/ShellCheck/Parser.hs +++ b/src/ShellCheck/Parser.hs @@ -1562,6 +1562,7 @@ readDollarVariable = do let singleCharred p = do n <- p value <- wrap [n] + endPosOfStartId id return $ (T_DollarBraced id value) let positional = do @@ -1575,6 +1576,7 @@ readDollarVariable = do let regular = do name <- readVariableName value <- wrap name + endPosOfStartId id return (T_DollarBraced id value) `attempting` do lookAhead $ char '[' parseNoteAt pos ErrorC 1087 "Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet)."