Crate weedle [−] [src]
Weedle - A WebIDL Parser
Parses valid WebIDL definitions & produces a data structure starting from
Definitions
.
Example
extern crate weedle; let (_, parsed) = weedle::parse(" interface Window { readonly attribute Storage sessionStorage; }; ").unwrap(); println!("{:?}", parsed);
Note: This parser tries to follow the grammar given at WebIDL but is not one-to-one. Makes necessary assumptions as per the real world WebIDL definitions.
First, the parser only allows stricter attributes defined in the grammar.
Second, No inner [attributes]
are allowed. For example the following is allowed:
[attributes] attribute Type identifier
instead of
[attributes] attribute AttributedType AttributeName
where AttributedType
is [attribute] Type
and AttributeName
is one of
required|identifier
.
Using attributes within declaration is redundant. Only preceding attributes to declarations & arguments are considered.
Also identifier
takes in any valid value regardless of whether it is keyword or not.
Modules
argument | |
attribute | |
common | |
dictionary | |
interface | |
literal | |
mixin | |
namespace | |
term | |
types |
Macros
opt_flat |
Return valid option as it is & convert |
term | |
test_variants | |
weedle |
Structs
CallbackDefinition |
Parses |
CallbackInterfaceDefinition |
Parses |
Definitions |
Parses WebIDL definitions |
DictionaryDefinition |
Parses |
EnumDefinition |
Parses |
IncludesStatementDefinition |
Parses |
InterfaceDefinition |
Parses |
InterfaceMixinDefinition |
Parses |
NamespaceDefinition |
Parses |
PartialDictionaryDefinition |
Parses |
PartialInterfaceDefinition |
Parses |
PartialInterfaceMixinDefinition |
Parses |
PartialNamespaceDefinition |
Parses |
TypedefDefinition |
Parses |
Enums
Definition |
Parses a definition |
Traits
Parse |
Functions
parse |
Type Definitions
EnumValueList |
Parses a non-empty enum value list |