aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViljar Indus <indus@adacore.com>2024-07-17 13:08:23 +0300
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-08-29 15:06:28 +0200
commitad4c549ac201176288ffe60b54c4693a2b3b1a43 (patch)
tree563a880f6eb36842e1523f087ceb69975dbcefe0
parentf60b53cc2002af545aea5eae9b5fd08a21da7555 (diff)
downloadgcc-ad4c549ac201176288ffe60b54c4693a2b3b1a43.zip
gcc-ad4c549ac201176288ffe60b54c4693a2b3b1a43.tar.gz
gcc-ad4c549ac201176288ffe60b54c4693a2b3b1a43.tar.bz2
ada: Restructure continuation message for pretty printing
Continuation messages should have the same location as the main message. If the goal is to point to a different location then Error_Msg_Sloc should be used to change the location of the continuation message. gcc/ada/ * par-ch4.adb (P_Name): Use Error_Msg_Sloc for the location of the continuation message.
-rw-r--r--gcc/ada/par-ch4.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 8b491c2..e76b0d8 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -218,6 +218,8 @@ package body Ch4 is
Arg_List : List_Id := No_List; -- kill junk warning
Attr_Name : Name_Id := No_Name; -- kill junk warning
+ Error_Loc : Source_Ptr;
+
begin
-- Case of not a name
@@ -889,13 +891,16 @@ package body Ch4 is
("positional parameter association " &
"not allowed after named one");
+ Error_Loc := Token_Ptr;
+
Expr_Node := P_Expression_If_OK;
-- Leaving the '>' in an association is not unusual, so suggest
-- a possible fix.
if Nkind (Expr_Node) = N_Op_Eq then
- Error_Msg_N ("\maybe `='>` was intended", Expr_Node);
+ Error_Msg_Sloc := Sloc (Expr_Node);
+ Error_Msg ("\maybe `='>` was intended #", Error_Loc);
end if;
-- We go back to scanning out expressions, so that we do not get