File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 49
49
def_l_less( ) ,
50
50
def_l_less_equal( ) ,
51
51
def_l_not_equal( ) ,
52
+ def_l_and( ) ,
52
53
def_l_or( ) ,
53
54
def_mid( ) ,
54
55
def_object_type( ) ,
@@ -305,6 +306,27 @@ where
305
306
. map ( |( ( ) , result) | Ok ( result) )
306
307
}
307
308
309
+ fn def_l_and < ' a , ' c > ( ) -> impl Parser < ' a , ' c , AmlValue >
310
+ where
311
+ ' c : ' a ,
312
+ {
313
+ /*
314
+ * DefLAnd := 0x90 Operand Operand
315
+ * Operand := TermArg => Integer
316
+ */
317
+ opcode ( opcode:: DEF_L_AND_OP )
318
+ . then ( comment_scope (
319
+ DebugVerbosity :: AllScopes ,
320
+ "DefLOr" ,
321
+ term_arg ( ) . then ( term_arg ( ) ) . map_with_context ( |( left_arg, right_arg) , context| {
322
+ let left = try_with_context ! ( context, left_arg. as_bool( ) ) ;
323
+ let right = try_with_context ! ( context, right_arg. as_bool( ) ) ;
324
+ ( Ok ( AmlValue :: Boolean ( left && right) ) , context)
325
+ } ) ,
326
+ ) )
327
+ . map ( |( ( ) , result) | Ok ( result) )
328
+ }
329
+
308
330
fn def_l_or < ' a , ' c > ( ) -> impl Parser < ' a , ' c , AmlValue >
309
331
where
310
332
' c : ' a ,
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ pub const DEF_SHIFT_RIGHT: u8 = 0x7a;
68
68
pub const DEF_AND_OP : u8 = 0x7b ;
69
69
pub const DEF_CONCAT_RES_OP : u8 = 0x84 ;
70
70
pub const DEF_OBJECT_TYPE_OP : u8 = 0x8e ;
71
+ pub const DEF_L_AND_OP : u8 = 0x90 ;
71
72
pub const DEF_L_OR_OP : u8 = 0x91 ;
72
73
pub const DEF_L_NOT_OP : u8 = 0x92 ;
73
74
pub const DEF_L_EQUAL_OP : u8 = 0x93 ;
You can’t perform that action at this time.
0 commit comments