From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50 autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:5750:: with SMTP id 16mr14292424qtx.305.1608509504447; Sun, 20 Dec 2020 16:11:44 -0800 (PST) X-Received: by 2002:ac8:4e47:: with SMTP id e7mr14368761qtw.262.1608509504202; Sun, 20 Dec 2020 16:11:44 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 20 Dec 2020 16:11:43 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=4.34.23.173; posting-account=JSxOkAoAAADa00TJoz2WZ_46XrZCdXeS NNTP-Posting-Host: 4.34.23.173 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <75fbea31-93f7-4b0d-bd73-34c4beefff44n@googlegroups.com> Subject: Help parsing the language manual on Get'ing integers from Strings From: John Perry Injection-Date: Mon, 21 Dec 2020 00:11:44 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:60905 List-Id: Hello all Sorry if the subject is unclear. I recently tried to use Get(S, Value, Last); ...in a program where Value was a Natural and S has the value "29: 116 82 |= 119 24". GNAT gave me a Data_Error. I don't understand why. Here's what the language manual says: "Reads an integer value from the beginning of the given string, following t= he same rules as the Get procedure that reads an integer value from a file,= but treating the end of the string as a file terminator. ...The exception = Data_Error is propagated if the sequence input does not have the required s= yntax or if the value obtained is not of the subtype Num." The referenced Get procedure says, (some irrelevant (?) parts omitted) "...skips any leading blanks, line terminators, or page terminators, then .= ..reads the longest possible sequence of characters matching the syntax of = a numeric literal without a point." I've used this procedure before, and as far as I can tell: - GNAT is fine with "29:" - GNAT is NOT fine with "29: " or any larger substring of S So: 1) Apparently GNAT thinks the colon is a character that matches the syntax = of a numeric literal; do I interpret this correctly? 2) Where does the language manual say this? I didn't see it in Section 3.5.= 4 ("Integer Types"). 3) or is this a bug? 4) or do I misinterpret the language manual? sincere thanks john perry