GNU bug report logs -
#56236
Package: emacs, ada-mode
Previous Next
Reported by: Cameron Howie <howiect <at> yahoo.com>
Date: Sun, 26 Jun 2022 15:51:01 UTC
Severity: normal
Done: Stephen Leake <stephen_leake <at> stephe-leake.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56236 in the body.
You can then email your comments to 56236 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Sun, 26 Jun 2022 15:51:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Cameron Howie <howiect <at> yahoo.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 26 Jun 2022 15:51:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I'm using Ada Mode version 7.2.0. The internal parser is currently failing to handle Ada 2022 "declare expression" syntax. This leads to other problems like various parsing-sensitive commands failing. My only (current) solution is to use older Ada syntax.
Many thanks for this plug-in :)
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Sun, 26 Jun 2022 15:55:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 56236 <at> debbugs.gnu.org (full text, mbox):
Cameron Howie via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:
> I'm using Ada Mode version 7.2.0. The internal parser is currently
> failing to handle Ada 2022 "declare expression" syntax. This leads to
> other problems like various parsing-sensitive commands failing. My
> only (current) solution is to use older Ada syntax.
Do you have a code snippet that demonstrates these problems?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Sun, 26 Jun 2022 16:11:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 56236 <at> debbugs.gnu.org (full text, mbox):
(Resending with the debbugs address in the CC header so that it lands in
the bug tracker.)
Cameron Howie <howiect <at> yahoo.com> writes:
> No immediately, Lars, no. However, I can send one through tomorrow. Off the top of
> my head, the issue arises when I use a declare expression in a Post condition, so
> something like this:
>
> procedure Foo
> (x, y : Integer;
> arr : in out Integer_Array)
> with Post => (declare sum : constant Integer := Sum_Elements (arr); begin sum >= x
> + y);
>
> I've not yet used the declare expression syntax in a subprogram body, just (so far) in
> contract specifications.
>
> On Sunday, June 26, 2022, 05:54:21 PM GMT+2, Lars Ingebrigtsen <larsi <at> gnus.org>
> wrote:
>
> Cameron Howie via "Bug reports for GNU Emacs, the Swiss army knife of
>
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> I'm using Ada Mode version 7.2.0. The internal parser is currently
>> failing to handle Ada 2022 "declare expression" syntax. This leads to
>> other problems like various parsing-sensitive commands failing. My
>> only (current) solution is to use older Ada syntax.
>
> Do you have a code snippet that demonstrates these problems?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Tue, 28 Jun 2022 11:28:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 56236 <at> debbugs.gnu.org (full text, mbox):
Cameron Howie <howiect <at> yahoo.com> writes:
> I didn't want to send to the "56236 <at> debbugs.gnu.org address as you may
> have some better way of handling this internally...
I've now resent your mail to 56236 <at> debbugs.gnu.org. Including that in
the CCs is the way debbugs works.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Tue, 28 Jun 2022 13:25:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 56236 <at> debbugs.gnu.org (full text, mbox):
(Forwarding to make it land in the bug tracker; resending didn't work,
apparently.)
Cameron Howie <howiect <at> yahoo.com> writes:
> Hi Lars,
>
> Following up on the emails of yesterday, I have pasted below into this message a
> concrete example Ada code that raises issues with the Ada Mode plug-in regarding
> using of a "declaration expression" inside a Postcondition. As commented in the code
> itself, if you remove the comment markers from the Postcondition the Ada Mode
> parser indicates all sorts of errors when in fact the Postcondition is legal Ada 2022.
>
> I didn't want to send to the "56236 <at> debbugs.gnu.org address as you may have some
> better way of handling this internally...
>
> -------- EXAMPLE FILE main.adb STARTS HERE
>
> -- Build with e.g., "gnatmake main.adb -gnat2020"
> -- EMACS ADA MODE ISSUE: remove the 'commented out' Postcondition for
> -- Absolute_Difference and the Ada Mode parser signals
> -- all sorts of errors.
>
> with Ada.Text_IO; use Ada.Text_IO;
>
> procedure Main
> is
> procedure Absolute_Difference
> (x, y : Integer;
> diff : out Integer)
> -- with Post => (declare
> -- min : constant Integer := Integer'Min(x, y);
> -- max : constant Integer := Integer'Max(x, y);
> -- begin diff = max - min)
> is
> begin
> diff := abs x - y;
> end Absolute_Difference;
>
> u : constant Integer := 95;
> v : constant Integer := 5;
> d : Integer;
> begin
> Absolute_Difference (u, v, diff => d);
> Put_Line ("Absolute difference =" & d'Img); -- prints "90"
> end Main;
>
> -------- END OF EXAMPLE FILE main.adb
>
> On Sunday, June 26, 2022, 06:09:57 PM GMT+2, Lars Ingebrigtsen <larsi <at> gnus.org>
> wrote:
>
> (Resending with the debbugs address in the CC header so that it lands in
> the bug tracker.)
>
> Cameron Howie <howiect <at> yahoo.com> writes:
>
>> No immediately, Lars, no. However, I can send one through tomorrow. Off the top
> of
>> my head, the issue arises when I use a declare expression in a Post condition, so
>> something like this:
>>
>> procedure Foo
>> (x, y : Integer;
>> arr : in out Integer_Array)
>> with Post => (declare sum : constant Integer := Sum_Elements (arr); begin sum >=
> x
>> + y);
>>
>> I've not yet used the declare expression syntax in a subprogram body, just (so far)
> in
>> contract specifications.
>>
>> On Sunday, June 26, 2022, 05:54:21 PM GMT+2, Lars Ingebrigtsen
> <larsi <at> gnus.org>
>> wrote:
>>
>> Cameron Howie via "Bug reports for GNU Emacs, the Swiss army knife of
>>
>> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>>
>>> I'm using Ada Mode version 7.2.0. The internal parser is currently
>>> failing to handle Ada 2022 "declare expression" syntax. This leads to
>>> other problems like various parsing-sensitive commands failing. My
>>> only (current) solution is to use older Ada syntax.
>>
>> Do you have a code snippet that demonstrates these problems?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Tue, 28 Jun 2022 13:52:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 56236 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>> Following up on the emails of yesterday, I have pasted below into this message a
>> concrete example Ada code that raises issues with the Ada Mode plug-in regarding
>> using of a "declaration expression" inside a Postcondition. As commented in the code
>> itself, if you remove the comment markers from the Postcondition the Ada Mode
>> parser indicates all sorts of errors when in fact the Postcondition is legal Ada 2022.
I've added Stephen to the CCs; perhaps he has some comments.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Tue, 28 Jun 2022 14:37:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 56236 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Lars,
Following up on the emails of yesterday, I have pasted below into this message a concrete example Ada code that raises issues with the Ada Mode plug-in regarding using of a "declaration expression" inside a Postcondition. As commented in the code itself, if you remove the comment markers from the Postcondition the Ada Mode parser indicates all sorts of errors when in fact the Postcondition is legal Ada 2022.
I didn't want to send to the "56236 <at> debbugs.gnu.org address as you may have some better way of handling this internally...
-------- EXAMPLE FILE main.adb STARTS HERE
-- Build with e.g., "gnatmake main.adb -gnat2020"-- EMACS ADA MODE ISSUE: remove the 'commented out' Postcondition for -- Absolute_Difference and the Ada Mode parser signals -- all sorts of errors.
with Ada.Text_IO; use Ada.Text_IO;
procedure Mainis procedure Absolute_Difference (x, y : Integer; diff : out Integer) -- with Post => (declare -- min : constant Integer := Integer'Min(x, y); -- max : constant Integer := Integer'Max(x, y); -- begin diff = max - min) is begin diff := abs x - y; end Absolute_Difference;
u : constant Integer := 95; v : constant Integer := 5; d : Integer;begin Absolute_Difference (u, v, diff => d); Put_Line ("Absolute difference =" & d'Img); -- prints "90"end Main;
-------- END OF EXAMPLE FILE main.adb
On Sunday, June 26, 2022, 06:09:57 PM GMT+2, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
(Resending with the debbugs address in the CC header so that it lands in
the bug tracker.)
Cameron Howie <howiect <at> yahoo.com> writes:
> No immediately, Lars, no. However, I can send one through tomorrow. Off the top of
> my head, the issue arises when I use a declare expression in a Post condition, so
> something like this:
>
> procedure Foo
> (x, y : Integer;
> arr : in out Integer_Array)
> with Post => (declare sum : constant Integer := Sum_Elements (arr); begin sum >= x
> + y);
>
> I've not yet used the declare expression syntax in a subprogram body, just (so far) in
> contract specifications.
>
> On Sunday, June 26, 2022, 05:54:21 PM GMT+2, Lars Ingebrigtsen <larsi <at> gnus.org>
> wrote:
>
> Cameron Howie via "Bug reports for GNU Emacs, the Swiss army knife of
>
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> I'm using Ada Mode version 7.2.0. The internal parser is currently
>> failing to handle Ada 2022 "declare expression" syntax. This leads to
>> other problems like various parsing-sensitive commands failing. My
>> only (current) solution is to use older Ada syntax.
>
> Do you have a code snippet that demonstrates these problems?
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56236
; Package
emacs
.
(Tue, 28 Jun 2022 23:56:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 56236 <at> debbugs.gnu.org (full text, mbox):
The development verison of ada-mode parses this, and indents it nicely:
procedure Absolute_Difference
(X, Y : Integer;
Diff : out Integer)
with Post =>
(declare
Min : constant Integer := Integer'Min (X, Y);
Max : constant Integer := Integer'Max (X, Y);
begin Diff = Max - Min)
is begin
Diff := abs X - Y;
end Absolute_Difference;
Time for a new release.
--
-- Stephe
bug reassigned from package 'emacs' to 'emacs,ada-mode'.
Request was from
Stefan Kangas <stefan <at> marxist.se>
to
control <at> debbugs.gnu.org
.
(Wed, 29 Jun 2022 14:56:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org, stephen_leake <at> stephe-leake.org
:
bug#56236
; Package
emacs,ada-mode
.
(Mon, 10 Oct 2022 21:09:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 56236 <at> debbugs.gnu.org (full text, mbox):
Note that the devel version can now be accessed via the devel ELPA
package:
M-; (add-to-list 'package-archives (cons "gnu-devel" "https://elpa.gnu.org/devel"))
M-x list-packages
install ada-mode 7.3.beta
--
-- Stephe
Reply sent
to
Stephen Leake <stephen_leake <at> stephe-leake.org>
:
You have taken responsibility.
(Wed, 25 Jan 2023 14:04:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Cameron Howie <howiect <at> yahoo.com>
:
bug acknowledged by developer.
(Wed, 25 Jan 2023 14:04:02 GMT)
Full text and
rfc822 format available.
Message #36 received at 56236-close <at> debbugs.gnu.org (full text, mbox):
closed by ada-mode version 8.0.4
--
-- Stephe
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 23 Feb 2023 12:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 61 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.