[Bug 18424] New: Cannot parse static operation with ReturnType (WebIDL editors draft 10 July 2012)

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

           Summary: Cannot parse static operation with ReturnType (WebIDL
                    editors draft 10 July 2012)
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebIDL
        AssignedTo: cam@mcc.id.au
        ReportedBy: tasak@google.com
         QAContact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-script-coord@w3.org


According to the grammar: http://dev.w3.org/2006/webapi/WebIDL/#idl-grammar, we
cannot use static operations which have return types. 

 I think, 

[38]    AttributeOrOperationRest    →    AttributeRest 
                                              | OperationRest 
                                              | ";"

should be

[38]    AttributeOrOperationRest    →    AttributeRest 
                                              | ReturnType OperationRest 
                                              | ";"

For example, suppose that we have "static void classMethod();" declared as
"interface member".
According to the grammar: http://dev.w3.org/2006/webapi/WebIDL/#idl-grammar,

[10]    InterfaceMember    →    Const 
                                              | AttributeOrOperationOrIterator

the text matches the rule: InterfaceMember -> AttributeOrOperationOrIterator.

[30]    AttributeOrOperationOrIterator    →    Serializer 
                                              | Qualifier
AttributeOrOperationRest 
                                              | Attribute 
                                              | OperationOrIterator

the text matches the rule: AttributeOrOperationOrIterator -> Qualifier
AttributeOrOperationRest.

[37]    Qualifier    →    "static" 
                                             | "stringifier"

the text matches the rule: Qualifier -> "static".

[38]    AttributeOrOperationRest    →    AttributeRest 
                                              | OperationRest 
                                              | ";"

the text matches the rule: AttributeOrOperationRest -> OperationRest.

[51]    OperationRest    →    OptionalIdentifier "(" ArgumentList ")" ";"

The OptionalIdentifier matches "void", not "classMethod". So as "(" doesn't
match "classMethod", "static classMethod();" is rejected.

Best regards,
Takashi Sakamoto

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

Received on Friday, 27 July 2012 12:13:03 UTC