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 4949 def_l_less( ) ,
5050 def_l_less_equal( ) ,
5151 def_l_not_equal( ) ,
52+ def_l_and( ) ,
5253 def_l_or( ) ,
5354 def_mid( ) ,
5455 def_object_type( ) ,
@@ -305,6 +306,27 @@ where
305306 . map ( |( ( ) , result) | Ok ( result) )
306307}
307308
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+
308330fn def_l_or < ' a , ' c > ( ) -> impl Parser < ' a , ' c , AmlValue >
309331where
310332 ' c : ' a ,
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ pub const DEF_SHIFT_RIGHT: u8 = 0x7a;
6868pub const DEF_AND_OP : u8 = 0x7b ;
6969pub const DEF_CONCAT_RES_OP : u8 = 0x84 ;
7070pub const DEF_OBJECT_TYPE_OP : u8 = 0x8e ;
71+ pub const DEF_L_AND_OP : u8 = 0x90 ;
7172pub const DEF_L_OR_OP : u8 = 0x91 ;
7273pub const DEF_L_NOT_OP : u8 = 0x92 ;
7374pub const DEF_L_EQUAL_OP : u8 = 0x93 ;
You can’t perform that action at this time.
0 commit comments