File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ crate-type = ["cdylib"]
10
10
serde_json = " 1.0"
11
11
ratel = { path = " ../ratel" , version = " 0.8.0" }
12
12
ratel-codegen = { path = " ../ratel-codegen" , version = " 0.8.0" }
13
- wasm-bindgen = " 0.2.29 "
13
+ wasm-bindgen = " 0.2.36 "
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ impl<T> Deref for Loc<T> {
80
80
}
81
81
}
82
82
83
+ #[ derive( Debug , Clone ) ]
83
84
pub struct Program < ' ast > {
84
85
pub source : & ' ast str ,
85
86
pub body : NodeList < ' ast , Statement < ' ast > > ,
Original file line number Diff line number Diff line change 1
1
use toolshed:: list:: UnsafeList ;
2
2
use toolshed:: Arena ;
3
3
use ast:: StatementList ;
4
+
5
+ use std:: fmt;
4
6
use std:: marker:: PhantomData ;
5
7
8
+
6
9
/// A JavaScript module parsed to an AST.
7
10
pub struct Module < ' ast > {
8
11
body : UnsafeList ,
@@ -32,3 +35,13 @@ impl<'ast> Module<'ast> {
32
35
& self . arena
33
36
}
34
37
}
38
+
39
+ impl < ' ast > fmt:: Debug for Module < ' ast > {
40
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
41
+ write ! ( f, "Module:" ) . unwrap ( ) ;
42
+ for elem in self . body ( ) . iter ( ) {
43
+ write ! ( f, "\n \t {:?}" , elem) . unwrap ( )
44
+ }
45
+ Ok ( ( ) )
46
+ }
47
+ }
You can’t perform that action at this time.
0 commit comments