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.0 required=3.0 tests=BAYES_40,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a37:6189:: with SMTP id v131mr15768760qkb.337.1608543221063; Mon, 21 Dec 2020 01:33:41 -0800 (PST) X-Received: by 2002:ac8:690f:: with SMTP id e15mr15145039qtr.100.1608543220905; Mon, 21 Dec 2020 01:33:40 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 21 Dec 2020 01:33:40 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.133; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 94.31.101.133 References: <75fbea31-93f7-4b0d-bd73-34c4beefff44n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <95ce39f8-b57b-4ea9-94a6-929dd8b9e234n@googlegroups.com> Subject: Re: Help parsing the language manual on Get'ing integers from Strings From: AdaMagica Injection-Date: Mon, 21 Dec 2020 09:33:41 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:60912 List-Id: Niklas Holsti schrieb am Montag, 21. Dezember 2020 um 08:44:33 UTC+1: > "12: 44 " works, Value = 12 and Last = 2 > "18: 44 " fails with Data_Error. > "18:44:" fails with Data_Error > "12:44:" works, Value = 52, Last = 6. > > 1) Apparently GNAT thinks the colon is a character that matches the > > syntax of a numeric literal; do I interpret this correctly? > It seems that the Get procedure understands ':' as a base indicator, as in > "12#44#" works, Value = 52, Last = 6. > "12#44" fails with Data_Error. RM J.2(2). This looks like a GNAT bug. If it accepts "12: 44" as 12, leaving ": 44" in the input stream, it cannot be interpreting : as a replacement of #, since 12# 44" correctly raises Data_Error and also "12: 44" is incorrect syntax for base 12. But then it also has to be accept 18: 44" as 18, leaving " 44" in the input stream, although 18: 44" is incorrect syntax for a based numeral. The behaviour is inconsequent and should be reported.