Skip to content

Commit 924e127

Browse files
authored
refactor + tests (#4)
1 parent 679f677 commit 924e127

33 files changed

+1231
-1162
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ edition = "2021"
88
[dependencies]
99
nom = "7.1.1"
1010
phf = { version = "0.11", features = ["macros"] }
11+
itertools = "0.10.5"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ fn main() {
3232

3333
## TODO
3434
- [ ] Better documentation
35-
- [ ] Add tests
35+
- [ ] Add more tests
3636
- [ ] Replace asserts with custom errors in parser
3737
- [ ] Validate Web IDL semantically (more)
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
callback Foo = Bar ();
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
callback interface Foo {
2+
};

resources/dictionary_simple.idl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dictionary Foo {
2+
};

resources/enumeration_simple.idl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enum Foo {
2+
};

resources/includes_simple.idl

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Foo includes Bar;

resources/interface_mixin_simple.idl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
interface mixin Foo {
2+
};

resources/interface_simple.idl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
interface Foo {
2+
};

resources/namespace_simple.idl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
namespace Foo {
2+
};

resources/typedef_simple.idl

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
typedef Foo Bar;

src/definitions.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub enum DefaultValue {
140140
Dictionary,
141141
}
142142

143-
/* Functionality implementations. */
143+
/* Functionality implementations */
144144

145145
impl Definition {
146146
pub fn get_identifier(&self) -> Option<&str> {
@@ -195,3 +195,8 @@ impl Definition {
195195
}
196196
}
197197
}
198+
199+
/* Trait implementations */
200+
201+
// ...
202+
// ...

0 commit comments

Comments
 (0)