comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Help parsing the language manual on Get'ing integers from Strings
Date: Mon, 21 Dec 2020 01:33:40 -0800 (PST)	[thread overview]
Message-ID: <95ce39f8-b57b-4ea9-94a6-929dd8b9e234n@googlegroups.com> (raw)
In-Reply-To: <i4b22uF79iqU1@mid.individual.net>

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.

  reply	other threads:[~2020-12-21  9:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21  0:11 Help parsing the language manual on Get'ing integers from Strings John Perry
2020-12-21  7:44 ` Niklas Holsti
2020-12-21  9:33   ` AdaMagica [this message]
2020-12-21  7:57 ` Dmitry A. Kazakov
2020-12-21  8:06   ` Niklas Holsti
2020-12-21  9:40     ` Jeffrey R. Carter
2020-12-22  1:11       ` Randy Brukardt
2020-12-21  8:16   ` Dmitry A. Kazakov
2020-12-21 11:30 ` John Perry
2020-12-21 23:25   ` John Perry
2020-12-22  1:19     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox