This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Doubts about digit grouping corner cases


On Sat, Jan 03, 2004 at 12:47:29PM +0100, Paolo Carlini wrote:
> Hi,
> 
> according to the standard, digit grouping is checked during Stage 3:
> 22.2.2.1.2, p12.
> 
> However, we have some code in _M_extract_int (and float) dealing with
> corner cases (basically, __sep_pos == 0) during Stage 2. Testcases
> in:
> 
>    27_io/basic_istream/extractors_arithmetic/char/07.cc
> 
> It seems to me that we could deal easily - and in a strictly conforming
> way - with __sep_pos == 0 in __verify_grouping, thus simplifying the
> Stage2 parsing loop.
> 
> The only user visible effect would be that the iterator would point
> after the last digit, not to the first bad thousands_sep. But, again,
> in my reading, this is conforming.

Besides the description of the phases of numeric parsing, there
is also the BNF descriptions of number formats found in the
num_punct section.  The idea is, the syntax tells you what
characters to extract, and then the rest tells how to construct a 
number from the characters extracted, or to fail.

Nathan Myers
ncm-nospam@cantrip.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]