summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVidar Holen <spam@vidarholen.net>2016-03-19 16:13:54 -0700
committerVidar Holen <spam@vidarholen.net>2016-03-19 16:13:54 -0700
commit2957fb64c9b42e7c745d3fc4c69715cb6f3eb8c2 (patch)
treed2c64f995f63a9f523bbcccaac969139203190f0
parent459e30804f00c8472dad88bead569a1492378d89 (diff)
Allow parsing 'time ( foo )'
-rw-r--r--ShellCheck/Parser.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs
index 519f20e..e0b09da 100644
--- a/ShellCheck/Parser.hs
+++ b/ShellCheck/Parser.hs
@@ -1698,6 +1698,7 @@ readTermOrNone = do
eof
return []
+prop_readTerm = isOk readTerm "time ( foo; bar; )"
readTerm = do
allspacing
m <- readAndOr
@@ -2051,6 +2052,7 @@ readFunctionDefinition = called "function" $ do
readWithoutFunction = try $ do
id <- getNextId
name <- readFunctionName
+ guard $ name /= "time" -- Interfers with time ( foo )
spacing
readParens
return $ T_Function id (FunctionKeyword False) (FunctionParentheses True) name