From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cameron Howie Newsgroups: gmane.emacs.bugs Subject: bug#56236: Package: emacs, ada-mode Date: Mon, 27 Jun 2022 16:26:09 +0000 (UTC) Message-ID: <2026151234.5124962.1656347169126@mail.yahoo.com> References: <302935684.2763160.1656258301795.ref@mail.yahoo.com> <302935684.2763160.1656258301795@mail.yahoo.com> <87ilonctee.fsf@gnus.org> <1632297600.4892837.1656259625032@mail.yahoo.com> <87edzbcsog.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5124961_314593352.1656347169123" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2322"; mail-complaints-to="usenet@ciao.gmane.io" To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 28 16:37:36 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6CLP-0000Qu-OY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 16:37:35 +0200 Original-Received: from localhost ([::1]:54902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6CLO-0005wN-2N for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 10:37:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6CKt-0005uX-DF for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 10:37:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6CKt-00073R-3R for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 10:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6CKt-0006WO-12 for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 10:37:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Cameron Howie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jun 2022 14:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56236 X-GNU-PR-Package: emacs Original-Received: via spool by 56236-submit@debbugs.gnu.org id=B56236.165642700825004 (code B ref 56236); Tue, 28 Jun 2022 14:37:02 +0000 Original-Received: (at 56236) by debbugs.gnu.org; 28 Jun 2022 14:36:48 +0000 Original-Received: from localhost ([127.0.0.1]:55966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6CKd-0006VC-Jr for submit@debbugs.gnu.org; Tue, 28 Jun 2022 10:36:48 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:47462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o69Mm-0000gy-59 for 56236@debbugs.gnu.org; Tue, 28 Jun 2022 07:26:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Subject:References:In-Reply-To: Message-ID:To:From:Date:Resent-Message-ID:Resent-Date:Resent-From:Resent-To: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Sender:Resent-Cc:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=eMvhe218qWVK/jA+XpWHOJ6+CTaq5JtsKvnD1nzrFmc=; b=hYnlujRzlgth3A4BMNKjNc1koi w4QgePKJyIjbHk8xHP11pgF6hA/Dncb4euxlttzltIwCYatLpizlhWLAbPNJ4POKE7EbkHaJltuwf yhTwludoPTXT28huAiyiblDmcgfTBrAJAR26gDWu63xaKL1tnCl2wCpxrliHqBNHMa74=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o69MT-0001Wu-6g for 56236@debbugs.gnu.org; Tue, 28 Jun 2022 13:26:42 +0200 Resent-X-Now-Playing: Alabama Sacred Harp Singers's _Anthology of American Folk Music: Social Music (2)_: "Present Joys" Resent-To: 56236@debbugs.gnu.org Resent-From: Lars Ingebrigtsen Resent-Date: Tue, 28 Jun 2022 13:26:28 +0200 Resent-Message-ID: <87fsjpt4ez.fsf@gnus.org> Original-Received: from sonic306-2.consmr.mail.bf2.yahoo.com ([74.6.132.41]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o5rYy-0008M0-Ht for larsi@gnus.org; Mon, 27 Jun 2022 18:26:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1656347170; bh=eMvhe218qWVK/jA+XpWHOJ6+CTaq5JtsKvnD1nzrFmc=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=SzJUe2/ziD0D5wctmLGfhnKis1FXfJ9DDOQBvxS/AFAIjNbs0D/BRoWmHnKe9tStO0sBhpU8NZrRUdWiyWZm6R5R7UGaPM52DJUQWb9ydyejySqOuvBQCKLbLLkOwjymB8Q/T7Yv5ZPWHTXaTnMDMuLFkCPy5UrEVoUSnOfKyHc2AxZA4+CkDc6HsgXWt4Lh2La601oh4mWyJmge1rY9hN0a675gKfx03/Y+XHN8lAj4dxQ8puKd8/vomGAofkeECOVlNgCZlTDdsaaDP3ATKmHS+joic/pzE9/Oo8AsJW0wfbfd95MEmsoTCYBdeIFMX9SSSdgL4DAQeRU8QmzZdQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1656347170; bh=mjkEOhYIHW37mKALS03qnAgSSAQuRQ9mlZ3bYIapHyr=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=auGg34Szw/oNWSHF1ITG4NeoAl9OmfSJJ29h9c/QsHImIFR1XPPfEN5pVvi5tFAWBxtm2fzcfThv6PsjfnU/xQ7VrcAp5JitYADKB+2fEaVzVAmfMZI3aHJIA7ux0WhWsgsiiLsTKSnZfxwSV/EcR9wD4Kk1Z82xjgo9zZBYB5BuJBptCfCcBMFhRbcqL5JyBOh9QHprgrzeFe/Lz+kBsRabDFcXN+5iMljl/CBVi33PZdLAM7L1nZj5PBIjOZw6hRd2s0QA00lcO49TiBfm2yScJJJpsm+9aDR+c+8RKvQQWbKCOoHWc+hXCUYAyoZe2k1ZcW+lpjVT+weAYFojew== X-YMail-OSG: VxdzyE8VM1kd6LLi6fQvTt72o02daaGeh1O1cZizCGT9vg5y10qXUFMcHMamhbj NUgR2nE1ZuF8fJkZe0w9lIWQGsrUdxxW9QlR8tQ97QeUt_rS0k9rukPKlpxlNwgRxEomvvmgZkEI s39VCc11XXP9vEdB.5sZnSwprM4AhDLJMFl2ma1OBik42yTzC1NWvAH4aZfkX32yHDepDgEIa9Pw yF1RBeoHw59HufOcDFDLY7bf4AfzZWAhGQITv2c76f9q3vEe0EKQZderZxM.0e30PRJlzh5Kz98C WSzVihKe2rCko5jbeRDaUf9YdP1cKBtSDYNkO43IvrUYr.Oh7DTyzz_VdzJGP7HKopRvdYU3PKR4 R7SIKJEhLBBVP28gbTGRU2BL9jNzFQ6VSbijQyciRx0OQkhXLz8THFZbLZwnVE89bauc0fNkYjwI tiBvX3qudwfSfezEajlhlNW4JMwbdzI4Ps8dn7tp7mkyJnSEI_CEp_8GxSJnvnK.fecP.s0GH.6k BQT4kb0.vI4H5bI5wJ3hYbF5r3pvC30PncMo1b8kMz3oZG6qXbp0ApjbNVrfnF.XlhnrdamQEi1n DWu8CR39ybZ8.jjUgTxwg2a.mdjAAMU4JsBPuucd2X3Kk5DCwrPdRT6WjJkvQGeCYB9mi2xlC_5o BYKU0wedBbJP9rA7FjkYvepXo8uZ291_azArM5u1xj2K4jtyCN9eITrWZLytVBXKXPXVqtP.JUCH 7jaZ88KEmOOjEj9WyajOJaA.w_xe7hB721IYeGvOAa1d8alps_H8QLiyb2bf9En.b0j.NQKM_O7z Cg3JBGUHxGc_oSdPP7mFY1u7mosiTJ7wKccBcIO5V. X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Mon, 27 Jun 2022 16:26:10 +0000 In-Reply-To: <87edzbcsog.fsf@gnus.org> X-Mailer: WebService/1.1.20280 YMailNorrin X-Mailman-Approved-At: Tue, 28 Jun 2022 10:36:46 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235552 Archived-At: ------=_Part_5124961_314593352.1656347169123 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Lars,=C2=A0 Following up on the emails of yesterday, I have pasted below into this mess= age a concrete example Ada code that raises issues with the Ada Mode plug-i= n regarding using of a "declaration expression" inside a Postcondition. As = commented in the code itself, if you remove the comment markers from the Po= stcondition 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@debbugs.gnu.org address as you may have= some better way of handling this internally... -------- EXAMPLE FILE main.adb STARTS HERE --=C2=A0 Build with e.g., "gnatmake main.adb -gnat2020"--=C2=A0 EMACS ADA M= ODE ISSUE: remove the 'commented out' Postcondition for=C2=A0--=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 A= bsolute_Difference and the Ada Mode parser signals=C2=A0--=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 all sort= s of errors. with Ada.Text_IO; use Ada.Text_IO; procedure Mainis=C2=A0 =C2=A0procedure Absolute_Difference=C2=A0 =C2=A0 =C2= =A0(x, y : Integer;=C2=A0 =C2=A0 =C2=A0 diff : out Integer)=C2=A0 =C2=A0 = =C2=A0 --=C2=A0 with Post =3D> (declare=C2=A0 =C2=A0 =C2=A0 --=C2=A0 =C2=A0= =C2=A0min : constant Integer :=3D Integer'Min(x, y);=C2=A0 =C2=A0 =C2=A0 -= -=C2=A0 =C2=A0 =C2=A0max : constant Integer :=3D Integer'Max(x, y);=C2=A0 = =C2=A0 =C2=A0 --=C2=A0 =C2=A0 =C2=A0begin diff =3D max - min)=C2=A0 =C2=A0i= s=C2=A0 =C2=A0begin=C2=A0 =C2=A0 =C2=A0 diff :=3D abs x - y;=C2=A0 =C2=A0en= d Absolute_Difference; =C2=A0 =C2=A0u : constant Integer :=3D 95;=C2=A0 =C2=A0v : constant Integer= :=3D 5;=C2=A0 =C2=A0d : Integer;begin=C2=A0 =C2=A0Absolute_Difference (u, = v, diff =3D> d);=C2=A0 =C2=A0Put_Line ("Absolute difference =3D" & d'Img);= =C2=A0 --=C2=A0 prints "90"end Main; -------- END OF EXAMPLE FILE main.adb On Sunday, June 26, 2022, 06:09:57 PM GMT+2, Lars Ingebrigtsen wrote: =20 =20 (Resending with the debbugs address in the CC header so that it lands in the bug tracker.) Cameron Howie writes: > No immediately, Lars, no. However, I can send one through tomorrow. Off t= he top of > my head, the issue arises when I use a declare expression in a Post condi= tion, so > something like this: > > procedure Foo=20 >=C2=A0 =C2=A0 (x, y : Integer;=20 >=C2=A0 =C2=A0 =C2=A0 arr : in out Integer_Array) > with Post =3D> (declare sum : constant Integer :=3D Sum_Elements (arr); b= egin sum >=3D x > + y); > > I've not yet used the declare expression syntax in a subprogram body, jus= t (so far) in > contract specifications.=20 > > On Sunday, June 26, 2022, 05:54:21 PM GMT+2, Lars Ingebrigtsen > wrote:=20 > > Cameron Howie via "Bug reports for GNU Emacs, the Swiss army knife of > > text editors" 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? =20 ------=_Part_5124961_314593352.1656347169123 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 p= lug-in regarding using of a "declaration expression" inside a Postcondition= . As commented in the code itself, if you remove the comment markers from t= he Postcondition the Ada Mode parser indicates all sorts of errors when in = fact the Postcondition is legal Ada 2022.

I didn't want t= o send to the "56236@debbugs.gnu.org address as you may have some better wa= y of handling this internally...

-------- EXAMPLE FILE ma= in.adb STARTS HERE

--  Build with e.g., "g= natmake main.adb -gnat2020"
--  EMACS ADA MODE ISSUE: remove= the 'commented out' Postcondition for 
--    &nbs= p;                   Absolute_= Difference and the Ada Mode parser signals 
--    =                     all s= orts of errors.

with Ada.Text_IO; use Ada.Text_IO;=

procedure Main
is
  &nbs= p;procedure Absolute_Difference
     (x, y : Integ= er;
      diff : out Integer)
  &nb= sp;   --  with Post =3D> (declare
    &nbs= p; --     min : constant Integer :=3D Integer'Min(x, y);
      --     max : constant Integer := =3D Integer'Max(x, y);
      --     = ;begin diff =3D max - min)
   is
   = ;begin
      diff :=3D abs x - y;
 =  end Absolute_Difference;

   u : c= onstant Integer :=3D 95;
   v : constant Integer :=3D 5= ;
   d : Integer;
begin
  &nbs= p;Absolute_Difference (u, v, diff =3D> d);
   Put_Li= ne ("Absolute difference =3D" & d'Img);  --  prints "90"
end Main;

-------- END OF EXAMPLE FILE main.adb




=20
=20
On Sunday, June 26, 2022, 06:09:57 PM GMT+2, Lars Ingeb= rigtsen <larsi@gnus.org> wrote:


(Resending with the debbugs address i= n the CC header so that it lands in
the bug tracker.)

Cameron Howie <howiect@yahoo.com> writes:

> No immediately, Lars, no. However, I= can send one through tomorrow. Off the top of
> my he= ad, the issue arises when I use a declare expression in a Post condition, s= o
> something like this:
>
> procedure Foo
>    (x, y := Integer;
>      arr : in out Integer_= Array)
> with Post =3D> (declare sum : constant Int= eger :=3D Sum_Elements (arr); begin sum >=3D x
> + = y);
>
> I've not yet used the dec= lare 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 <<= a shape=3D"rect" ymailto=3D"mailto:larsi@gnus.org" href=3D"mailto:larsi@gnu= s.org">larsi@gnus.org>
> wrote:
>
> Cameron Howie via "Bug reports for GNU Emac= s, the Swiss army knife of
>
> te= xt editors" <bug-gnu-emacs@gnu.org> writes:=
>
>> I'm using Ada Mode versi= on 7.2.0. The internal parser is currently
>> faili= ng to handle Ada 2022 "declare expression" syntax. This leads to
>> other problems like various parsing-sensitive commands f= ailing. My
>> only (current) solution is to use old= er Ada syntax.
>
> Do you have a = code snippet that demonstrates these problems?
------=_Part_5124961_314593352.1656347169123--