Go to file
Javier Miranda 9ef547a7a9 ada: INOX: prototype RFC on String Interpolation
This patch incorporates a prototype for a new string literal syntax
which supports the use of "string interpolation," where the names
of variables or expressions can be used directly within the string
literal, such that the value of the variable or the expression is
"interpolated" directly into the value of the enclosing string
upon use at run-time.

gcc/ada/

	* scans.ads (Tok_Left_Curly_Bracket, Tok_Right_Curly_Bracket)
	(Tok_Left_Interpolated_String): Placed in no category since they
	don't fit well in the existing categories. Fix typo in comment.
	(Inside_Interpolated_String_Literal): New scan state variable.
	* scng.adb (Slit): Scan interpolated string literals,
	continuations of interpolated string literals and escaped
	characters found in interpolated string literals.
	(Scan): Handle consecutive interpolated expressions. Handle ending
	delimiter placed immediately after an interpolated expression.
	Handle string literal placed after interpolated expression. Handle
	left and right curly brackets; when extensions are not allowed
	they are treated as left and right paren; when extensions are
	allowed they are handled as delimiters of interpolated string
	literals.
	* sinfo.ads (N_Interpolated_String_Literal): New node.
	* gen_il-gen-gen_nodes.adb (N_Interpolated_String_Literal): Define
	N_String_Literal node.
	* gen_il-types.ads (Opt_Type_Enum): Define N_String_Literal as
	concrete node type.
	* par-ch2.adb (P_Interpolated_String_Literal): New subprogram.
	* par-ch4.adb (P_Simple_Expression): Handle '}' as expression
	terminator when scanning an interpolated expression; disable error
	recovery machinery for binary operator when we are processing an
	interpolated string literal and reach the expression terminator
	'}'.
	(P_Primary): Call P_Interpolated_String_Literal when the opening
	interpolated-string-literal delimiter is found (that is, the left
	curly bracket '{').
	* par-tchk.adb (T_Right_Curly_Bracket): New subprogram.
	* par.adb (P_Interpolated_String_Literal): New declaration.
	(T_Right_Curly_Bracket): New declaration.
	* sem.adb (Analyze): Call Analyze_Interpolated_String_Literal.
	* sem_ch2.ads (Analyze_Interpolated_String_Literal): New
	subprogram
	* sem_ch2.adb (Analyze_Interpolated_String_Literal): Likewise.
	* sem_util.adb (Is_User_Defined_Literal): Complete mapping of
	literal aspects adding that interpolated string literals have no
	correspondence with any aspect.
	* sem_res.adb (Resolve_Interpolated_String_Literal): New
	subprogram.
	(Has_Applicable_User_Defined_Literal): Complete mapping of literal
	aspects adding that interpolated string literals have no
	correspondency with any aspect.
	* expander.adb (Expand): Add call to
	Expand_N_Interpolated_String_Literal.
	* exp_util.adb (Insert_Actions): Handle
	N_Interpolated_String_Literal nodes; that is, continue climbing.
	* exp_ch2.ads (Expand_N_Interpolated_String_Literal): New
	subprogram.
	* exp_ch2.adb (Expand_N_Interpolated_String_Literal): Likewise.
	* exp_put_image.adb (Build_Elementary_Put_Image_Call): Add missing
	conversion to force dispatching call. Required to handle calls to
	descendants.
	(Build_String_Put_Image_Call): Do not output string delimiters
	when the put_image call is part of an interpolated string literal.
	* rtsfind.ads (RTU_Id): Add RE_Set_Trim_Leading_Spaces.
	* sprint.adb (Sprint_Node): Output interpolated string contents.
	* libgnat/a-stbubo.adb (Get_UTF_8): Add default value for
	Trim_Leading_White_Spaces component in aggregate.
	(Buffer_Type_Implementation): Update Trim_Leading_White_Spaces.
	* libgnat/a-stbuun.adb (Get_UTF_8): Likewise.
	(Buffer_Type_Implementation): Likewise.
	* libgnat/a-sttebu.ads (Set_Trim_Leading_Spaces): New subprogram.
	(Trim_Leading_Spaces): New subprogram.
	(Root_Buffer_Type): Adding Trim_Leading_While_Spaces component.
	* libgnat/a-sttebu.adb (procedure Set_Trim_Leading_Spaces): New
	subprogram.
	(Trim_Leading_Space): New subprogram.
	(Put_UTF_8): Handle Trim_Leading_White_Spaces.
	(New_Line): Likewise.
	* libgnat/s-putima.ads (Put_Image_String): Adding formal
	(with_delimiters).
	(Put_Image_Wide_String): Likewise.
	(Put_Image_Wide_Wide_String): Likewise.
	* libgnat/s-putima.adb (Put_Image_String): Adding support for new
	formal.
	(Put_Image_Wide_String): Likewise.
	(Put_Image_Wide_Wide_String): Likewise.
2023-01-05 15:30:00 +01:00
c++tools Update copyright years. 2023-01-02 09:40:19 +01:00
config Daily bump. 2022-11-15 08:32:29 +00:00
contrib Daily bump. 2022-12-29 00:17:39 +00:00
fixincludes Daily bump. 2022-11-24 00:17:47 +00:00
gcc ada: INOX: prototype RFC on String Interpolation 2023-01-05 15:30:00 +01:00
gnattools
gotools
include Daily bump. 2022-12-22 00:17:29 +00:00
INSTALL
intl Daily bump. 2022-11-24 00:17:47 +00:00
libada Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libatomic Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libbacktrace Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libcc1 Daily bump. 2022-11-02 00:17:38 +00:00
libcody Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libcpp Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libdecnumber Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libffi Daily bump. 2022-12-22 00:17:29 +00:00
libgcc Daily bump. 2023-01-04 00:17:22 +00:00
libgfortran Rotate ChangeLog files. 2023-01-01 16:20:13 +01:00
libgm2 Daily bump. 2023-01-05 00:17:41 +00:00
libgo libgo: check for makecontext in -lucontext 2022-12-20 19:34:55 -08:00
libgomp openmp: Fix up finish_omp_target_clauses [PR108286] 2023-01-05 11:57:30 +01:00
libiberty Daily bump. 2022-11-24 00:17:47 +00:00
libitm Daily bump. 2023-01-03 00:17:09 +00:00
libobjc Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libphobos Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libquadmath Daily bump. 2023-01-03 00:17:09 +00:00
libsanitizer Daily bump. 2022-12-20 00:17:00 +00:00
libssp
libstdc++-v3 libstdc++: Support single components in name of chrono::current_zone() [PR108211] 2023-01-05 00:46:00 +00:00
libvtv changelog: Fix extra space after tab. 2022-11-21 10:13:44 +01:00
lto-plugin Daily bump. 2022-11-24 00:17:47 +00:00
maintainer-scripts Daily bump. 2022-12-01 00:17:51 +00:00
zlib Daily bump. 2022-11-24 00:17:47 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2023-01-05 00:17:41 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure [PATCH] Use toplevel configure for GMP and MPFR for gdb 2022-12-21 17:18:53 +00:00
configure.ac [PATCH] Use toplevel configure for GMP and MPFR for gdb 2022-12-21 17:18:53 +00: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: Add myself as Modula-2 front-end maintainer 2023-01-04 12:52:15 +00:00
Makefile.def configure: Do not build the ununsed libffi shared library. 2022-12-31 17:51:47 +00:00
Makefile.in configure: Do not build the ununsed libffi shared library. 2022-12-31 17:51:47 +00:00
Makefile.tpl Merge modula-2 front end onto gcc. 2022-12-14 17:43:08 +00: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.