On Mon, Feb 6, 2012 at 2:43 PM, Mark Miesfeld <[email protected]> wrote:
> On Mon, Feb 6, 2012 at 11:30 AM, Jean-Louis Faucher <[email protected]>
> wrote:
>>
>> rev 6673 in scanner.cpp seems the reason of this change.
>
>
> Actually rev 6674.
>
>
>>
>> 2012/2/6 Rick McGuire <[email protected]>
>>>
>>> The rule that applies here is not the definition of a number, but the
>>> definition of a SYMBOL.  Section 1.10.4.4.  This states:
>>>
>>> One other form of symbol is allowed to support the representation of
>>> numbers in exponential format. The
>>> symbol starts with a digit (0-9) or a period, and it can end with the
>>> sequence E or e, followed immediately
>>> by an optional sign (- or +), followed immediately by one or more
>>> digits (which cannot be followed by
>>> any other symbol characters). The sign in this context is part of the
>>> symbol and is not an operator.
>>> These are valid numbers in exponential notation:
>>> 17.3E-12
>>> .03e+9
>>>
>>> By this definition, 3ae+6 should be scanned as a single symbol token
>>> (the old behavior).  I'm not aware of any updates that would have
>>> changed this behavior.
>>>
>>>
>>>
>
>
>
> But is 3ae+6 an exponential number?  Does the part before the 'E' have to be
> a decimal number, or can it be a hexidecimal number?  3A

Whether it is a number or not is not the issue.  The issue is whether
it is considered a symbol or not during scanning.  For example, 3a is
a symbol token, and it is only when you try to do arithmetic with its
value do any numeric rules get applied.  At issue here is whether the
scanner rules for exponential notation require this to be interpreted
as a single token, or two tokens with an operator between.  By the
rules we have in our documentation, then 3ae+6, 3..0+6, and .ae+6
should all be single tokens.  Prior to that "bug fix", only the first
of these was interpreted as a single symbol token.  After the update,
none of these were.  Our working definition, I believe, goes all the
way back to Mike's original definition.  However, I think I just found
the relevant section in the ANSI standard, which states:

– EXPONENT_SIGN occurs when the character about to be scanned is '+'
or '-', and the
characters to the left of the sign, currently parsed as part of
Const_symbol, represent a
plain_number followed by 'E' or 'e', and the characters to the right
of the sign represent a
repetition of digit not followed by a general_letter or '.'.

So, by this definition, the exponent is only recognized as part of the
symbol if the token scanned so far is a "plain number" (consisting of
at least one digit and at most one ".").  So by the ANSI definition,
3ae+6 should NOT be treated as a single token, but rather as two
tokens with a operator between then.  The error is the correct
behavior here, and this truly was a bug fix :-)

Rick

>
> --
> Mark Miesfeld
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to