From b46be8a2b70f416b8c12697885b5c7a315a3aeba Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Tue, 7 Jul 2009 10:36:25 +0000 Subject: scng.adb: Minor reformattting 2009-07-07 Robert Dewar * scng.adb: Minor reformattting * par-ch2.adb (Scan_Pragma_Argument_Association): Pragma argument association allows conditional expression without parens. * par-ch4.adb (P_Name): Attribute arguments can be conditional expressions without enclosing parentheses, and also as parameters, indexing expressions etc. (P_Conditional_Expression): New procedure (P_Expression_If_OK): New procedure * par.adb (P_Conditional_Expression): New procedure (P_Expression_If_OK): New procedure * sem_ch4.adb (Analyze_Conditional_Expression): Allow for two argument form of conditional expression. * sem_res.adb (Resolve_Conditional_Expression): Deal with supplying missing True argument if ELSE argument missing. * sinfo.adb (Is_Elsif): New flag * sinfo.ads (N_Conditional_Expression): This node is now a syntactic part of the language, and the documentation is modified accordingly. (Is_Elsif): New flag From-SVN: r149316 --- gcc/ada/scng.adb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/ada/scng.adb') diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index e7d9edc..30da224 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -2412,11 +2412,16 @@ package body Scng is Style.Non_Lower_Case_Keyword; end if; + -- Check THEN/ELSE style rules. These do not apply to AND THEN + -- or OR ELSE, and do not apply in conditional expressions. + if (Token = Tok_Then and then Prev_Token /= Tok_And) or else (Token = Tok_Else and then Prev_Token /= Tok_Or) then - Style.Check_Separate_Stmt_Lines; + if Inside_Conditional_Expression = 0 then + Style.Check_Separate_Stmt_Lines; + end if; end if; end if; @@ -2550,7 +2555,6 @@ package body Scng is else exit Tabs_Loop; end if; - end loop Tabs_Loop; return Start_Column; -- cgit v1.1