diff options
author | Robert Dewar <dewar@adacore.com> | 2009-07-07 10:36:25 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-07-07 12:36:25 +0200 |
commit | b46be8a2b70f416b8c12697885b5c7a315a3aeba (patch) | |
tree | 11684252ac8961c0cd28bf14e54a318aa0ed8157 /gcc/ada/par.adb | |
parent | f062f8f2307ae66bdeb176260841bd09a8765beb (diff) | |
download | gcc-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/par.adb')
-rw-r--r-- | gcc/ada/par.adb | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index 6a047db..769e3e4 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -664,7 +664,6 @@ is package Ch4 is function P_Aggregate return Node_Id; function P_Expression return Node_Id; - function P_Expression_No_Right_Paren return Node_Id; function P_Expression_Or_Range_Attribute return Node_Id; function P_Function_Name return Node_Id; function P_Name return Node_Id; @@ -673,9 +672,25 @@ is function P_Simple_Expression return Node_Id; function P_Simple_Expression_Or_Range_Attribute return Node_Id; - function P_Qualified_Expression - (Subtype_Mark : Node_Id) - return Node_Id; + function P_Conditional_Expression return Node_Id; + -- Scans out a conditional expression. Called with token pointing to + -- the IF keyword, and returns pointing to the terminating right paren, + -- semicolon or comma, but does not consume this terminating token. + + function P_Expression_If_OK return Node_Id; + -- Scans out an expression in a context where a conditional expression + -- is permitted to appear without surrounding parentheses. + + function P_Expression_No_Right_Paren return Node_Id; + -- Scans out an expression in contexts where the expression cannot be + -- terminated by a right paren (gives better error recovery if an errant + -- right paren is found after the expression). + + function P_Expression_Or_Range_Attribute_If_OK return Node_Id; + -- Scans out an expression or range attribute where a conditional + -- expression is permitted to appear without surrounding parentheses. + + function P_Qualified_Expression (Subtype_Mark : Node_Id) return Node_Id; -- This routine scans out a qualified expression when the caller has -- already scanned out the name and apostrophe of the construct. end Ch4; @@ -1131,6 +1146,7 @@ is function Token_Is_At_End_Of_Line return Boolean; -- Determines if the current token is the last token on the line + end Util; -------------- |