Go to file
Bob Duff 0ff936fe86 [Ada] Ada 2020: Allow declarative items mixed with statements
This patch implements a syntactic language extension that allows
declarative items to appear in a sequence of statements.  For example:

    for X in S'Range loop
        Item : Character renames S (X);
        Item := Transform (Item);
    end loop;

Previously, declare/begin/end was required, which is just noise.

gcc/ada/

	* par.adb (P_Declarative_Items): New function to parse a
	sequence of declarative items.
	(P_Sequence_Of_Statements): Add Handled flag, to indicate
	whether to wrap the result in a block statement.
	* par-ch3.adb (P_Declarative_Item): Rename P_Declarative_Items
	to be P_Declarative_Item, because it really only parses a single
	declarative item, and to avoid conflict with the new
	P_Declarative_Items. Add In_Statements.  We keep the old
	error-recovery mechanisms in place when In_Statements is False.
	When True, we don't want to complain about statements, because
	we are parsing a sequence of statements.
	(P_Identifier_Declarations): If In_Statements, and we see what
	looks like a statement, we no longer give an error. We return to
	P_Sequence_Of_Statements with Done = True, so it can parse the
	statement.
	* par-ch5.adb (P_Sequence_Of_Statements): Call
	P_Declarative_Items to parse declarative items that appear in
	the statement list.  Remove error handling code that complained
	about such items.  Check some errors conservatively.  Wrap the
	result in a block statement when necessary.
	* par-ch11.adb (P_Handled_Sequence_Of_Statements): Pass
	Handled => True to P_Sequence_Of_Statements.
	* types.ads (No, Present): New functions for querying
	Source_Ptrs (equal, not equal No_Location).
2022-07-12 12:24:14 +00:00
c++tools
config Daily bump. 2022-06-02 00:16:32 +00:00
contrib Daily bump. 2022-07-05 00:16:36 +00:00
fixincludes
gcc [Ada] Ada 2020: Allow declarative items mixed with statements 2022-07-12 12:24:14 +00:00
gnattools
gotools
include Daily bump. 2022-07-07 00:16:46 +00:00
INSTALL
intl
libada
libatomic Daily bump. 2022-06-03 00:16:40 +00:00
libbacktrace Daily bump. 2022-07-09 00:16:54 +00:00
libcc1 Daily bump. 2022-06-28 00:16:58 +00:00
libcody Daily bump. 2022-06-04 00:16:27 +00:00
libcpp Daily bump. 2022-07-11 00:16:25 +00:00
libdecnumber Daily bump. 2022-05-21 00:16:32 +00:00
libffi
libgcc Daily bump. 2022-06-26 00:16:33 +00:00
libgfortran Daily bump. 2022-06-30 00:16:46 +00:00
libgo libgo: handle stat st_atim32 field and SYS_SECCOMP 2022-06-30 12:35:08 -07:00
libgomp libgomp: Add tailing \n to gomp_debug 2022-07-12 11:10:50 +02:00
libiberty Daily bump. 2022-07-05 00:16:36 +00:00
libitm Daily bump. 2022-06-03 00:16:40 +00:00
libobjc
liboffloadmic Daily bump. 2022-07-05 00:16:36 +00:00
libphobos Daily bump. 2022-07-07 00:16:46 +00:00
libquadmath
libsanitizer libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream 2022-07-11 22:04:00 +02:00
libssp
libstdc++-v3 libstdc++: Prefer const T to std::add_const_t<T> 2022-07-12 09:13:45 +01:00
libvtv
lto-plugin Daily bump. 2022-07-08 00:16:22 +00:00
maintainer-scripts Daily bump. 2022-05-21 00:16:32 +00:00
zlib
.dir-locals.el
.gitattributes
.gitignore Vim swap files not ignored 2022-05-28 09:38:29 -06:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2022-07-05 00:16:36 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure [gdb/build] Fix gdbserver build with -fsanitize=thread 2022-06-27 10:52:23 +02:00
configure.ac [gdb/build] Fix gdbserver build with -fsanitize=thread 2022-06-27 10:52:23 +02:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS: fix alphabetic sorting 2022-07-04 12:16:32 +02:00
Makefile.def
Makefile.in Add TFLAGS to gcc's GCC_FOR_TARGET 2022-06-28 09:41:07 -03:00
Makefile.tpl Add TFLAGS to gcc's GCC_FOR_TARGET 2022-06-28 09:41:07 -03:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.