aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/scng.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2009-07-07 10:36:25 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-07-07 12:36:25 +0200
commitb46be8a2b70f416b8c12697885b5c7a315a3aeba (patch)
tree11684252ac8961c0cd28bf14e54a318aa0ed8157 /gcc/ada/scng.adb
parentf062f8f2307ae66bdeb176260841bd09a8765beb (diff)
downloadgcc-b46be8a2b70f416b8c12697885b5c7a315a3aeba.zip
gcc-b46be8a2b70f416b8c12697885b5c7a315a3aeba.tar.gz
gcc-b46be8a2b70f416b8c12697885b5c7a315a3aeba.tar.bz2
scng.adb: Minor reformattting
2009-07-07 Robert Dewar <dewar@adacore.com> * 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
Diffstat (limited to 'gcc/ada/scng.adb')
-rw-r--r--gcc/ada/scng.adb8
1 files changed, 6 insertions, 2 deletions
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;