[Bug 17435] New: WebIDL: Bug in definition of whitespace terminal?

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17435

           Summary: WebIDL: Bug in definition of whitespace terminal?
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebIDL
        AssignedTo: cam@mcc.id.au
        ReportedBy: wolfgangkeller@gmail.com
         QAContact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-script-coord@w3.org


In the definition of the terminals in section "A. IDL grammar" you'll find the
following definition of the whitespace terminal:

whitespace = [\t\n\r ]+|[\t\n\r ]*((//.*|/\*.*?\*/)[\t\n\r ]*)+

Let's look at its part specific to block comments ("/* ... */"):

/\*.*?\*/

What does this regular expression look for (see the referenced document
http://search.cpan.org/dist/perl/pod/perlre.pod for details):

a string '/*'
followed by 0 or more "any character (except newline)", not greedily (the
latter one follows by using '*?' instead of '*')
followed by the string '*/'.

What consequence does this have? The answer is that block comments can't
contain newline characters between the block comment delimiters - I don't
believe this is what you intend.

Thus I believe, the regular expression has to be fixed. I propose the following
fix, but better check it thrice for correctness:

We change the part

/\*.*?\*/
to
/\*[.\n]*?\*/

Thus the complete definition of the whitespace terminal changes to
whitespace = [\t\n\r ]+|[\t\n\r ]*((//.*|/\*[.\n]*?\*/)[\t\n\r ]*)+

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Thursday, 7 June 2012 10:40:58 UTC