From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Bob Duff Newsgroups: comp.lang.ada Subject: Re: Ada reference manual rule for doubled parentheses around if_expression? Date: Sat, 01 Aug 2015 09:42:14 -0400 Organization: A noiseless patient Spider Message-ID: <87mvybktvt.fsf@theworld.com> References: <864mkkz2hy.fsf@stephe-leake.org> <87r3nokwpf.fsf@theworld.com> <86r3nnjrv2.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="c446ee9ff25298b968d5d80ae6cc5dfb"; logging-data="14135"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1907fFut+wcKbIKVS2Q+hWQ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:vrs2fOuv4x2PymAqIKMfJ9McJEw= sha1:OMGl0RGu2CtSYFaEAtmrSzXeXx4= Xref: number.nntp.giganews.com comp.lang.ada:194605 Date: 2015-08-01T09:42:14-04:00 List-Id: Stephen Leake writes: > Bob Duff writes: > >> Stephen Leake writes: >> >>> I remember seeing some rule in the Ada reference manual that says the >>> doubled parens are not needed here. But now I can't find the rule, and I >>> don't want to edit my grammar without a reference. >>> >>> Anyone know where that rule is? or what to search for? >> >> 4.5.7(7). This is a syntax rule, despite not being written in BNF. >> I suggest you read the AARM annotations. > > Thanks. You're welcome. > There's a similar rule for quantified expressions in 4.5.8(4). Right. > GNAT also accepts this: > > function Expression_Function_1 (V : Integer) return Boolean > is (V = V and then True) > or else True; > > I think that's a bug, because there are no parens surrounding the > entire expression. I agree that's a bug. It doesn't seem to have anything to do with the special rules about conditional/quantified expressions. Or does it? If you report this to report@adacore.com, it will get fixed. - Bob