Commit 8aaeba8f by Robert Dewar Committed by Arnaud Charlet

par.adb: Minor reformatting Add ??? comment for possible bad comment

2009-07-15  Robert Dewar  <dewar@adacore.com>

	* par.adb: Minor reformatting
	Add ??? comment for possible bad comment

	* par-ch10.adb: Minor reformatting

From-SVN: r149677
parent 36366047
2009-07-15 Robert Dewar <dewar@adacore.com>
* par.adb: Minor reformatting
Add ??? comment for possible bad comment
* par-ch10.adb: Minor reformatting
2009-07-15 Ed Schonberg <schonberg@adacore.com> 2009-07-15 Ed Schonberg <schonberg@adacore.com>
* sem_warn.adb (Warn_On_Constant_Condition): if the constant condition * sem_warn.adb (Warn_On_Constant_Condition): if the constant condition
...@@ -29,8 +36,6 @@ ...@@ -29,8 +36,6 @@
2009-07-15 Robert Dewar <dewar@adacore.com> 2009-07-15 Robert Dewar <dewar@adacore.com>
* debug.adb: Add -gnatd.O to output SCO table
* lib-writ.adb (Write_Unit_Information): Use SCO_Output to output SCO * lib-writ.adb (Write_Unit_Information): Use SCO_Output to output SCO
information. information.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -243,6 +243,7 @@ package body Ch10 is ...@@ -243,6 +243,7 @@ package body Ch10 is
if Token = Tok_Private then if Token = Tok_Private then
Private_Sloc := Token_Ptr; Private_Sloc := Token_Ptr;
Set_Keyword_Casing (Current_Source_File, Determine_Token_Casing); Set_Keyword_Casing (Current_Source_File, Determine_Token_Casing);
if Style_Check then if Style_Check then
Style.Check_Indentation; Style.Check_Indentation;
end if; end if;
...@@ -321,6 +322,7 @@ package body Ch10 is ...@@ -321,6 +322,7 @@ package body Ch10 is
-- it hasn't already been done on seeing a WITH or PRIVATE. -- it hasn't already been done on seeing a WITH or PRIVATE.
Set_Keyword_Casing (Current_Source_File, Determine_Token_Casing); Set_Keyword_Casing (Current_Source_File, Determine_Token_Casing);
if Style_Check then if Style_Check then
Style.Check_Indentation; Style.Check_Indentation;
end if; end if;
...@@ -1059,7 +1061,6 @@ package body Ch10 is ...@@ -1059,7 +1061,6 @@ package body Ch10 is
Set_Proper_Body (Subunit_Node, Body_Node); Set_Proper_Body (Subunit_Node, Body_Node);
return Subunit_Node; return Subunit_Node;
end P_Subunit; end P_Subunit;
------------------ ------------------
......
...@@ -197,27 +197,27 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -197,27 +197,27 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- Handling of Reserved Words Used as Identifiers -- -- Handling of Reserved Words Used as Identifiers --
---------------------------------------------------- ----------------------------------------------------
-- Note: throughout the parser, the terms reserved word and keyword -- Note: throughout the parser, the terms reserved word and keyword are
-- are used interchangeably to refer to the same set of reserved -- used interchangeably to refer to the same set of reserved keywords
-- keywords (including until, protected, etc). -- (including until, protected, etc).
-- If a reserved word is used in place of an identifier, the parser -- If a reserved word is used in place of an identifier, the parser where
-- where possible tries to recover gracefully. In particular, if the -- possible tries to recover gracefully. In particular, if the keyword is
-- keyword is clearly spelled using identifier casing, e.g. Until in -- clearly spelled using identifier casing, e.g. Until in a source program
-- a source program using mixed case identifiers and lower case keywords, -- using mixed case identifiers and lower case keywords, then the keyword
-- then the keyword is treated as an identifier if it appears in a place -- is treated as an identifier if it appears in a place where an identifier
-- where an identifier is required. -- is required.
-- The situation is more complex if the keyword is spelled with normal -- The situation is more complex if the keyword is spelled with normal
-- keyword casing. In this case, the parser is more reluctant to -- keyword casing. In this case, the parser is more reluctant to consider
-- consider it to be intended as an identifier, unless it has some -- it to be intended as an identifier, unless it has some further
-- further confirmation. -- confirmation.
-- In the case of an identifier appearing in the identifier list of a -- In the case of an identifier appearing in the identifier list of a
-- declaration, the appearance of a comma or colon right after the -- declaration, the appearance of a comma or colon right after the keyword
-- keyword on the same line is taken as confirmation. For an enumeration -- on the same line is taken as confirmation. For an enumeration literal,
-- literal, a comma or right paren right after the identifier is also -- a comma or right paren right after the identifier is also treated as
-- treated as adequate confirmation. -- adequate confirmation.
-- The following type is used in calls to Is_Reserved_Identifier and -- The following type is used in calls to Is_Reserved_Identifier and
-- also to P_Defining_Identifier and P_Identifier. The default for all -- also to P_Defining_Identifier and P_Identifier. The default for all
...@@ -288,8 +288,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -288,8 +288,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- uncomfortably on the above example). -- uncomfortably on the above example).
-- We have two approaches to helping to control this situation. First we -- We have two approaches to helping to control this situation. First we
-- make every attempt to avoid swallowing the last END; if we can be -- make every attempt to avoid swallowing the last END; if we can be sure
-- sure that some error will result from doing so. In particular, we won't -- that some error will result from doing so. In particular, we won't
-- accept the END; unless it is exactly correct (in particular it must not -- accept the END; unless it is exactly correct (in particular it must not
-- have incorrect name tokens), and we won't accept it if it is immediately -- have incorrect name tokens), and we won't accept it if it is immediately
-- followed by end of file, WITH or SEPARATE (all tokens that unmistakeably -- followed by end of file, WITH or SEPARATE (all tokens that unmistakeably
...@@ -409,13 +409,13 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -409,13 +409,13 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- Scope Table -- -- Scope Table --
----------------- -----------------
-- The scope table, also referred to as the scope stack, is used to -- The scope table, also referred to as the scope stack, is used to record
-- record the current scope context. It is organized as a stack, with -- the current scope context. It is organized as a stack, with inner nested
-- inner nested entries corresponding to higher entries on the stack. -- entries corresponding to higher entries on the stack. An entry is made
-- An entry is made when the parser encounters the opening of a nested -- when the parser encounters the opening of a nested construct (such as a
-- construct (such as a record, task, package etc.), and then package -- record, task, package etc.), and then package Par.Endh uses this stack
-- Par.Endh uses this stack to deal with END lines (including properly -- to deal with END lines (including properly dealing with END nesting
-- dealing with END nesting errors). -- errors).
type SS_End_Type is type SS_End_Type is
-- Type of end entry required for this scope. The last two entries are -- Type of end entry required for this scope. The last two entries are
...@@ -446,8 +446,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -446,8 +446,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
Lreq : Boolean; Lreq : Boolean;
-- A flag indicating whether the label, if present, is required to -- A flag indicating whether the label, if present, is required to
-- appear on the end line. It is referenced only in the case of -- appear on the end line. It is referenced only in the case of Etyp is
-- Etyp = E_Name or E_Suspicious_Is where the name may or may not be -- equal to E_Name or E_Suspicious_Is where the name may or may not be
-- required (yes for labeled block, no in other cases). Note that for -- required (yes for labeled block, no in other cases). Note that for
-- all cases except begin, the question of whether a label is required -- all cases except begin, the question of whether a label is required
-- can be determined from the other fields (for loop, it is required if -- can be determined from the other fields (for loop, it is required if
...@@ -456,10 +456,10 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -456,10 +456,10 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
Ecol : Column_Number; Ecol : Column_Number;
-- Contains the absolute column number (with tabs expanded) of the -- Contains the absolute column number (with tabs expanded) of the
-- the expected column of the end assuming normal Ada indentation -- expected column of the end assuming normal Ada indentation usage. If
-- usage. If the RM_Column_Check mode is set, this value is used for -- the RM_Column_Check mode is set, this value is used for generating
-- generating error messages about indentation. Otherwise it is used -- error messages about indentation. Otherwise it is used only to
-- only to control heuristic error recovery actions. -- control heuristic error recovery actions.
Labl : Node_Id; Labl : Node_Id;
-- This field is used only for the LOOP and BEGIN cases, and is the -- This field is used only for the LOOP and BEGIN cases, and is the
...@@ -479,21 +479,21 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -479,21 +479,21 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- the proper location for implicit label declarations. -- the proper location for implicit label declarations.
Node : Node_Id; Node : Node_Id;
-- Empty except in the case of entries for IF and CASE statements, -- Empty except in the case of entries for IF and CASE statements, in
-- in which case it contains the N_If_Statement or N_Case_Statement -- which case it contains the N_If_Statement or N_Case_Statement node.
-- node. This is used for setting the End_Span field. -- This is used for setting the End_Span field.
Sloc : Source_Ptr; Sloc : Source_Ptr;
-- Source location of the opening token of the construct. This is -- Source location of the opening token of the construct. This is used
-- used to refer back to this line in error messages (such as missing -- to refer back to this line in error messages (such as missing or
-- or incorrect end lines). The Sloc field is not used, and is not set, -- incorrect end lines). The Sloc field is not used, and is not set, if
-- if a label is present (the Labl field provides the text name of the -- a label is present (the Labl field provides the text name of the
-- label in this case, which is fine for error messages). -- label in this case, which is fine for error messages).
S_Is : Source_Ptr; S_Is : Source_Ptr;
-- S_Is is relevant only if Etyp is set to E_Suspicious_Is or -- S_Is is relevant only if Etyp is set to E_Suspicious_Is or E_Bad_Is.
-- E_Bad_Is. It records the location of the IS that is considered -- It records the location of the IS that is considered to be
-- to be suspicious. -- suspicious.
Junk : Boolean; Junk : Boolean;
-- A boolean flag that is set true if the opening entry is the dubious -- A boolean flag that is set true if the opening entry is the dubious
...@@ -595,10 +595,9 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -595,10 +595,9 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- removed the ACCESS token -- removed the ACCESS token
procedure P_Component_Items (Decls : List_Id); procedure P_Component_Items (Decls : List_Id);
-- Scan out one or more component items and append them to the -- Scan out one or more component items and append them to the given
-- given list. Only scans out more than one declaration in the -- list. Only scans out more than one declaration in the case where the
-- case where the source has a single declaration with multiple -- source has a single declaration with multiple defining identifiers.
-- defining identifiers.
function P_Defining_Identifier (C : Id_Check := None) return Node_Id; function P_Defining_Identifier (C : Id_Check := None) return Node_Id;
-- Scan out a defining identifier. The parameter C controls the -- Scan out a defining identifier. The parameter C controls the
...@@ -619,6 +618,7 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -619,6 +618,7 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
(Allow_Anonymous_In_95 : Boolean := False) return Boolean; (Allow_Anonymous_In_95 : Boolean := False) return Boolean;
-- Ada 2005 (AI-231): Parse the null-excluding part. A True result -- Ada 2005 (AI-231): Parse the null-excluding part. A True result
-- indicates that the null-excluding part was present. -- indicates that the null-excluding part was present.
--
-- Allow_Anonymous_In_95 is True if we are in a context that allows -- Allow_Anonymous_In_95 is True if we are in a context that allows
-- anonymous access types in Ada 95, in which case "not null" is legal -- anonymous access types in Ada 95, in which case "not null" is legal
-- if it precedes "access". -- if it precedes "access".
...@@ -730,8 +730,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -730,8 +730,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
function P_Subprogram_Specification return Node_Id; function P_Subprogram_Specification return Node_Id;
procedure P_Mode (Node : Node_Id); procedure P_Mode (Node : Node_Id);
-- Sets In_Present and/or Out_Present flags in Node scanning past -- Sets In_Present and/or Out_Present flags in Node scanning past IN,
-- IN, OUT or IN OUT tokens in the source. -- OUT or IN OUT tokens in the source.
function P_Subprogram (Pf_Flags : Pf_Rec) return Node_Id; function P_Subprogram (Pf_Flags : Pf_Rec) return Node_Id;
-- Scans out any construct starting with either of the keywords -- Scans out any construct starting with either of the keywords
...@@ -782,19 +782,20 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -782,19 +782,20 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
package Ch10 is package Ch10 is
function P_Compilation_Unit return Node_Id; function P_Compilation_Unit return Node_Id;
-- Note: this function scans a single compilation unit, and -- Note: this function scans a single compilation unit, and checks that
-- checks that an end of file follows this unit, diagnosing -- an end of file follows this unit, diagnosing any unexpected input as
-- any unexpected input as an error, and then skipping it, so -- an error, and then skipping it, so that Token is set to Tok_EOF on
-- that Token is set to Tok_EOF on return. An exception is in -- return. An exception is in syntax-only mode, where multiple
-- syntax-only mode, where multiple compilation units are -- compilation units are permitted. In this case, P_Compilation_Unit
-- permitted. In this case, P_Compilation_Unit does not check -- does not check for end of file and there may be more compilation
-- for end of file and there may be more compilation units to -- units to scan. The caller can uniquely detect this situation by the
-- scan. The caller can uniquely detect this situation by the
-- fact that Token is not set to Tok_EOF on return. -- fact that Token is not set to Tok_EOF on return.
-- --
-- The Ignore parameter is normally set False. It is set True -- What about multiple unit/file capability that now exists???
-- in multiple unit per file mode if we are skipping past a unit --
-- that we are not interested in. -- The Ignore parameter is normally set False. It is set True in the
-- multiple unit per file mode if we are skipping past a unit that we
-- are not interested in.
end Ch10; end Ch10;
-------------- --------------
...@@ -807,8 +808,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -807,8 +808,8 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
function Parse_Exception_Handlers return List_Id; function Parse_Exception_Handlers return List_Id;
-- Parses the partial construct EXCEPTION followed by a list of -- Parses the partial construct EXCEPTION followed by a list of
-- exception handlers which appears in a number of productions, -- exception handlers which appears in a number of productions, and
-- and returns the list of exception handlers. -- returns the list of exception handlers.
end Ch11; end Ch11;
-------------- --------------
...@@ -920,15 +921,15 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is ...@@ -920,15 +921,15 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- left pointing to the semicolon rather than past it. -- left pointing to the semicolon rather than past it.
procedure Resync_Past_Semicolon_Or_To_Loop_Or_Then; procedure Resync_Past_Semicolon_Or_To_Loop_Or_Then;
-- Used if an error occurs while scanning a sequence of statements. -- Used if an error occurs while scanning a sequence of statements. The
-- The scan pointer is positioned past the next semicolon, or to the -- scan pointer is positioned past the next semicolon, or to the next
-- next occurrence of either then or loop, and the scan resumes. -- occurrence of either then or loop, and the scan resumes.
procedure Resync_To_When; procedure Resync_To_When;
-- Used when an error occurs scanning an entry index specification. -- Used when an error occurs scanning an entry index specification. The
-- The scan pointer is positioned to the next WHEN (or to IS or -- scan pointer is positioned to the next WHEN (or to IS or semicolon if
-- semicolon if either of these appear before WHEN, indicating -- either of these appear before WHEN, indicating another error has
-- another error has occurred). -- occurred).
procedure Resync_Semicolon_List; procedure Resync_Semicolon_List;
-- Used if an error occurs while scanning a parenthesized list of items -- Used if an error occurs while scanning a parenthesized list of items
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment