[Webkit-unassigned] [Bug 127667] New: Decimal::fromString's EBNF documentation does not match implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 26 19:04:56 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=127667

           Summary: Decimal::fromString's EBNF documentation does not
                    match implementation
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: joepeck at webkit.org
                CC: joepeck at webkit.org


Current documentation for Decimal::fromString says:

    // fromString supports following syntax EBNF:
    //  number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?
    //          | sign? '.' digit+ (exponent-marker sign? digit+)?
    //  sign ::= '+' | '-'
    //  exponent-marker ::= 'e' | 'E'
    //  digit ::= '0' | '1' | ... | '9'
    // Note: fromString doesn't support "infinity" and "nan".
    static Decimal fromString(const String&);

However in the implementation:

    1. It does not look possible to have "sign? '.'" at all.
    Test: "-.1"

    2. The documentation says "sign? '.' digit+" but it looks like "sign? '.' digit*" is possible. If so what happens? What should happen?
    Test: ".e1"

What should this code actually be doing? Where did that EBNF come from?

There used to be a chromium test for this. We should consider adding a test for this and testing more cases.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list