@@ -48,48 +48,49 @@ impl Matrix {
48
48
m33 : 1.0 ,
49
49
}
50
50
}
51
- pub fn to_expr ( & self ) -> Vec < Expr > {
51
+
52
+ // pub fn to_expr(&self) -> Vec<Expr> {
52
53
53
- let expr = Expr :: Object ( ObjectLit {
54
- span : DUMMY_SP ,
55
- props : vec ! [
56
- PropOrSpread :: Prop ( Box :: new( Prop :: KeyValue ( KeyValueProp {
57
- key: PropName :: Ident ( Ident :: new( "type" . into( ) , DUMMY_SP ) ) ,
58
- value: Expr :: Lit ( Lit :: Str ( swc_ecma_ast:: Str {
59
- span: DUMMY_SP ,
60
- value: "Matrix" . into( ) ,
61
- raw: None
62
- } ) ) . into( ) ,
63
- } ) ) ) ,
64
- PropOrSpread :: Prop ( Box :: new( Prop :: KeyValue ( KeyValueProp {
65
- key: PropName :: Ident ( Ident :: new( "value" . into( ) , DUMMY_SP ) ) ,
66
- value: Expr :: Array ( ArrayLit {
67
- span: DUMMY_SP ,
68
- elems: vec![
69
- Some ( generate_expr_lit_num!( self . m00 as f64 ) . into( ) ) ,
70
- Some ( generate_expr_lit_num!( self . m01 as f64 ) . into( ) ) ,
71
- Some ( generate_expr_lit_num!( self . m02 as f64 ) . into( ) ) ,
72
- Some ( generate_expr_lit_num!( self . m03 as f64 ) . into( ) ) ,
73
- Some ( generate_expr_lit_num!( self . m10 as f64 ) . into( ) ) ,
74
- Some ( generate_expr_lit_num!( self . m11 as f64 ) . into( ) ) ,
75
- Some ( generate_expr_lit_num!( self . m12 as f64 ) . into( ) ) ,
76
- Some ( generate_expr_lit_num!( self . m13 as f64 ) . into( ) ) ,
77
- Some ( generate_expr_lit_num!( self . m20 as f64 ) . into( ) ) ,
78
- Some ( generate_expr_lit_num!( self . m21 as f64 ) . into( ) ) ,
79
- Some ( generate_expr_lit_num!( self . m22 as f64 ) . into( ) ) ,
80
- Some ( generate_expr_lit_num!( self . m23 as f64 ) . into( ) ) ,
81
- Some ( generate_expr_lit_num!( self . m30 as f64 ) . into( ) ) ,
82
- Some ( generate_expr_lit_num!( self . m31 as f64 ) . into( ) ) ,
83
- Some ( generate_expr_lit_num!( self . m32 as f64 ) . into( ) ) ,
84
- Some ( generate_expr_lit_num!( self . m33 as f64 ) . into( ) ) ,
85
- ] ,
86
- } )
87
- . into( ) ,
88
- } ) ) ) ,
89
- ]
90
- } ) ;
91
- vec ! [ expr]
92
- }
54
+ // let expr = Expr::Object(ObjectLit {
55
+ // span: DUMMY_SP,
56
+ // props: vec![
57
+ // PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp {
58
+ // key: PropName::Ident(Ident::new("type".into(), DUMMY_SP)),
59
+ // value: Expr::Lit(Lit::Str(swc_ecma_ast::Str {
60
+ // span: DUMMY_SP,
61
+ // value: "Matrix".into(),
62
+ // raw: None
63
+ // })).into(),
64
+ // }))),
65
+ // PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp {
66
+ // key: PropName::Ident(Ident::new("value".into(), DUMMY_SP)),
67
+ // value: Expr::Array(ArrayLit {
68
+ // span: DUMMY_SP,
69
+ // elems: vec![
70
+ // Some(generate_expr_lit_num!(self.m00 as f64).into()),
71
+ // Some(generate_expr_lit_num!(self.m01 as f64).into()),
72
+ // Some(generate_expr_lit_num!(self.m02 as f64).into()),
73
+ // Some(generate_expr_lit_num!(self.m03 as f64).into()),
74
+ // Some(generate_expr_lit_num!(self.m10 as f64).into()),
75
+ // Some(generate_expr_lit_num!(self.m11 as f64).into()),
76
+ // Some(generate_expr_lit_num!(self.m12 as f64).into()),
77
+ // Some(generate_expr_lit_num!(self.m13 as f64).into()),
78
+ // Some(generate_expr_lit_num!(self.m20 as f64).into()),
79
+ // Some(generate_expr_lit_num!(self.m21 as f64).into()),
80
+ // Some(generate_expr_lit_num!(self.m22 as f64).into()),
81
+ // Some(generate_expr_lit_num!(self.m23 as f64).into()),
82
+ // Some(generate_expr_lit_num!(self.m30 as f64).into()),
83
+ // Some(generate_expr_lit_num!(self.m31 as f64).into()),
84
+ // Some(generate_expr_lit_num!(self.m32 as f64).into()),
85
+ // Some(generate_expr_lit_num!(self.m33 as f64).into()),
86
+ // ],
87
+ // })
88
+ // .into(),
89
+ // }))),
90
+ // ]
91
+ // });
92
+ // vec![expr]
93
+ // }
93
94
94
95
pub fn to_rn_expr ( & self ) -> Vec < Expr > {
95
96
vec ! [
0 commit comments