From e2da73bf4f540b6dc98c7abda94597e658c9c40a Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 31 Dec 2013 16:38:15 -0800 Subject: [PATCH] Fix for issue where 'while |' would be incorrectly interpreted as a "naked statement" causing a wonky error message --- parse_productions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse_productions.cpp b/parse_productions.cpp index 24962e534..53a90a56a 100644 --- a/parse_productions.cpp +++ b/parse_productions.cpp @@ -128,7 +128,7 @@ RESOLVE(statement) // Likewise if the next token doesn't look like an argument at all. This corresponds to e.g. a "naked if". bool naked_invocation_invokes_help = (token1.keyword != parse_keyword_begin && token1.keyword != parse_keyword_end); - if (naked_invocation_invokes_help && token2.type != parse_token_type_string) + if (naked_invocation_invokes_help && (token2.type == parse_token_type_end || token2.type == parse_token_type_terminate)) { return 4; }