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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: 'raise' in aspects? References: <85siilc88t.fsf@stephe-leake.org> Date: Wed, 22 Oct 2014 13:08:09 -0500 Message-ID: <85h9ywasfq.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt) Cancel-Lock: sha1:wn/weqHscZgC3OzwLlcoSssM5lM= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 9cc9b5447f290e3fb833021479 X-Received-Bytes: 1724 X-Received-Body-CRC: 3860946822 Xref: news.eternal-september.org comp.lang.ada:22676 Date: 2014-10-22T13:08:09-05:00 List-Id: Stephen Leake writes: > The Ada mode 5.0 parser rejects this code: > > subtype Integer_String is String > with Dynamic_Predicate => Integer'Value (Integer_String) in Integer > or else raise Constraint_Error with "not an integer string"; > > It complains that 'raise' is not allowed here. > > ALRM Annex P says the syntax for an aspect is: > > aspect_specification ::= > with aspect_mark [=> aspect_definition] {, > aspect_mark [=> aspect_definition] } > > aspect_mark ::= aspect_identifier['Class] > > aspect_definition ::= name | expression | identifier > > > And you can't put 'raise' in an expression, which is why the Ada mode > parser rejects it. > > But GNAT GPL 2014 accepts it. > > Can anyone point me to RM language that allows 'raise' in aspects? For the record: ai12-0022 adds "raise_expression" to the "relation" syntax. It's a binding interpretation on Ada 2012 http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0022-1.txt?rev=1.13 -- -- Stephe