<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17435</bug_id>
          
          <creation_ts>2012-06-07 10:40:49 +0000</creation_ts>
          <short_desc>WebIDL: Bug in definition of whitespace terminal?</short_desc>
          <delta_ts>2012-06-22 06:31:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Wolfgang Keller">wolfgangkeller</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68792</commentid>
    <comment_count>0</comment_count>
    <who name="Wolfgang Keller">wolfgangkeller</who>
    <bug_when>2012-06-07 10:40:49 +0000</bug_when>
    <thetext>In the definition of the terminals in section &quot;A. IDL grammar&quot; you&apos;ll find the following definition of the whitespace terminal:

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

Let&apos;s look at its part specific to block comments (&quot;/* ... */&quot;):

/\*.*?\*/

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

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

What consequence does this have? The answer is that block comments can&apos;t contain newline characters between the block comment delimiters - I don&apos;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 ]*)+</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69339</commentid>
    <comment_count>1</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-06-22 06:31:58 +0000</bug_when>
    <thetext>You are right, although this needs to be written as (.|\n) rather than [.\n].  Fixed now:

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.541;r2=1.542;f=h</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>