lib/webidl/parser/idl.treetop in webidl-0.1.4 vs lib/webidl/parser/idl.treetop in webidl-0.1.5

- old
+ new

@@ -7,23 +7,27 @@ rule Definitions ws metadef:(eal:ExtendedAttributeList ws d:Definition ws defs:Definitions)? ws <ParseTree::Definitions> end rule Definition - Module + CallbackOrInterface / Interface - / Dictionary / Partial + / Dictionary / Exception + / Enum / TypeDef / ImplementsStatement - / Enum end - - rule Module - "module" ws name:identifier ws "{" ws defs:Definitions ws "}" ws ";" <ParseTree::Module> + + rule CallbackOrInterface + "callback" ws obj:CallbackRestOrInterface { def build(parent) obj.build(parent) end } end + + rule CallbackRestOrInterface + CallbackRest / Interface + end rule Interface "interface" ws name:identifier ws inherits:Inheritance ws "{" ws members:InterfaceMembers ws "}" ws ";" <ParseTree::Interface> end @@ -86,9 +90,13 @@ end # extract to a generic Members syntax node? rule ExceptionMembers (eal:ExtendedAttributeList ws member:ExceptionMember ws members:ExceptionMembers ws <ParseTree::InterfaceMembers>)? + end + + rule CallbackRest + name:identifier ws "=" ws return_type:ReturnType ws "(" ws args:ArgumentList ")" ws ";" <ParseTree::Callback> end rule TypeDef "typedef" ws type:Type ws name:identifier ws ";" <ParseTree::TypeDef> end