Added warning for empty do clauses

This commit is contained in:
Vidar Holen 2013-01-23 17:12:05 -08:00
parent 389d5588d8
commit 844a07afa0
1 changed files with 4 additions and 0 deletions

View File

@ -1130,6 +1130,10 @@ readDoGroup loopPos = do
acceptButWarn g_Semi ErrorC "No semicolons directly after 'do'."
allspacing
optional (do
try . lookAhead $ g_Done
parseProblemAt loopPos ErrorC "Can't have empty do clauses (use 'true' as a no-op).")
commands <- readCompoundList
g_Done `orFail` do
parseProblemAt pos ErrorC "Couldn't find 'done' for this 'do'."