summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-05-17 10:04:47 -0600
committerkotfu <kotfu@kotfu.net>2018-05-17 10:04:47 -0600
commit490c8424c9be872538a5130734f120d0a34fdcaf (patch)
treeed2a665bcda8b583f21b953dc0eadc7945b517fe /cmd2/parsing.py
parent5c1c427bbe724d1ad002c86c097a6d25ca73909c (diff)
downloadcmd2-git-490c8424c9be872538a5130734f120d0a34fdcaf.tar.gz
Fix bug in sequential terminator logic
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r--cmd2/parsing.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index 9fe8f6eb..655e0c58 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -256,7 +256,16 @@ class StatementParser:
if cur_token.startswith(test_terminator):
terminator_pos = pos
terminator = test_terminator
+ # break the inner loop, and we want to break the
+ # outer loop too
break
+ else:
+ # this else clause is only run if the inner loop
+ # didn't execute a break. If it didn't, then
+ # continue to the next iteration of the outer loop
+ continue
+ # inner loop was broken, break the outer
+ break
if terminator:
if terminator == LINE_FEED: