From 9850d23dc37494f807b73cb6a76ec52d90ed723b Mon Sep 17 00:00:00 2001 From: arookas Date: Mon, 22 Feb 2016 16:35:03 -0500 Subject: [PATCH] Force parentheses for conditional statements Since for loops require them, might as well be consistent. --- ssc/sunscript.grammar | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssc/sunscript.grammar b/ssc/sunscript.grammar index 6f79c45..3deb192 100644 --- a/ssc/sunscript.grammar +++ b/ssc/sunscript.grammar @@ -198,9 +198,9 @@ builtin_declaration = builtin_modifiers IDENTIFIER parameter_list; builtin_modifiers = BUILTIN [CONST]; // flow control -if_statement = IF expression statement [ELSE statement]; -while_statement = WHILE expression statement; -do_statement = DO statement WHILE expression; +if_statement = IF L_PAREN expression R_PAREN statement [ELSE statement]; +while_statement = WHILE L_PAREN expression R_PAREN statement; +do_statement = DO statement WHILE L_PAREN expression R_PAREN; for_statement = FOR L_PAREN [for_declaration] SEMICOLON [for_condition] SEMICOLON [for_iteration] R_PAREN statement; for_declaration = compound_statement; for_condition = expression;