From: Javier Miranda <mira...@adacore.com> gcc/ada/
* par-ch2.adb (P_Interpolated_String_Literal): remove support of multi-line string literals. * doc/gnat_rm/gnat_language_extensions.rst: Update documentation. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/gnat_language_extensions.rst | 16 ++-------------- gcc/ada/gnat_rm.texi | 16 ++-------------- gcc/ada/par-ch2.adb | 12 ++---------- 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst index feceff24e21..0f001c4aca9 100644 --- a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst +++ b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst @@ -323,20 +323,8 @@ For example: f" a double quote is \" and" & f" an open brace is \{"); -Finally, a syntax is provided for creating multi-line string literals, -without having to explicitly use an escape sequence such as ``\n``. For -example: - -.. code-block:: ada - - Put_Line - (f"This is a multi-line" - "string literal" - "There is no ambiguity about how many" - "spaces are included in each line"); - -Here is a link to the original RFC : -https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-string-interpolation.rst +Link to the original RFC: +https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-string-interpolation.md Constrained attribute for generic objects ----------------------------------------- diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 24c2fdd4f97..b27bd627c17 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -29223,20 +29223,8 @@ Put_Line f" an open brace is \@{"); @end example -Finally, a syntax is provided for creating multi-line string literals, -without having to explicitly use an escape sequence such as @code{\n}. For -example: - -@example -Put_Line - (f"This is a multi-line" - "string literal" - "There is no ambiguity about how many" - "spaces are included in each line"); -@end example - -Here is a link to the original RFC : -@indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-string-interpolation.rst} +Link to the original RFC: +@indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-string-interpolation.md} @node Constrained attribute for generic objects,Static aspect on intrinsic functions,String interpolation,Curated Extensions @anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{448} diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb index f09daeaba69..f249ae76023 100644 --- a/gcc/ada/par-ch2.adb +++ b/gcc/ada/par-ch2.adb @@ -224,7 +224,6 @@ package body Ch2 is function P_Interpolated_String_Literal return Node_Id is Elements_List : constant List_Id := New_List; - NL_Node : Node_Id; Saved_State : constant Boolean := Inside_Interpolated_String_Literal; String_Node : Node_Id; @@ -258,15 +257,8 @@ package body Ch2 is T_Right_Curly_Bracket; end; else - if Prev_Token = Tok_String_Literal then - NL_Node := New_Node (N_String_Literal, Token_Ptr); - Set_Has_Wide_Character (NL_Node, False); - Set_Has_Wide_Wide_Character (NL_Node, False); - - Start_String; - Store_String_Char (Get_Char_Code (ASCII.LF)); - Set_Strval (NL_Node, End_String); - Append_To (Elements_List, NL_Node); + if Prev_Token /= Tok_Right_Curly_Bracket then + Error_Msg_SC ("unexpected string literal"); end if; Append_To (Elements_List, Token_Node); -- 2.45.2