[RFC] Doubts about digit grouping corner cases

Paolo Carlini pcarlini@unitus.it
Sun Jan 4 10:29:00 GMT 2004


Nathan Myers wrote:

> 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.

Perhaps now I get your points. I take it like this: there is a set of,
so to speak, "general requirements" on the groupings, stated in the
num_punct section, to which *any* number must conform. Those must
be checked during Stage2. Then, there are the specific requirements
encoded in do_grouping, which must checked toward the end of Stage3.

Well, this is definitely reasonable, but the description of Stage2
(and Stage3) in 22.2.2.1.2 doesn't mention at all the first part!!
In particular, in 22.2.2.1.2, p8-9 there is absolutely no mention
of the fact that discard may become true or false depending also on
the last parsed char! Not just so, something much stronger: Stage2
may terminate *only* because in == end, not for different reasons,
like two consecutive true discard!!!

Perhaps the Standard should be clarified?!?!

Paolo.




More information about the Libstdc++ mailing list