File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,14 @@ where
124124 * Predicate := TermArg => Integer (0 = false, >0 = true)
125125 * DefElse := Nothing | <0xa1 PkgLength TermList>
126126 */
127+
128+ let maybe_else_opcode = |input, context| match opcode ( opcode:: DEF_ELSE_OP ) . parse ( input, context) {
129+ Err ( ( x, y, Propagate :: Err ( AmlError :: UnexpectedEndOfStream ) ) ) => {
130+ Err ( ( x, y, Propagate :: Err ( AmlError :: WrongParser ) ) )
131+ }
132+ r => r,
133+ } ;
134+
127135 opcode ( opcode:: DEF_IF_ELSE_OP )
128136 . then ( comment_scope (
129137 DebugVerbosity :: Scopes ,
@@ -135,11 +143,11 @@ where
135143 . map ( move |then_branch| Ok ( ( predicate_arg. as_bool ( ) ?, then_branch) ) )
136144 } )
137145 . then ( choice ! (
138- opcode ( opcode :: DEF_ELSE_OP )
146+ maybe_else_opcode
139147 . then( comment_scope(
140148 DebugVerbosity :: AllScopes ,
141149 "DefElse" ,
142- pkg_length( ) . feed( |length| take_to_end_of_pkglength( length) )
150+ pkg_length( ) . feed( |length| take_to_end_of_pkglength( length) ) ,
143151 ) )
144152 . map( |( ( ) , else_branch) : ( ( ) , & [ u8 ] ) | Ok ( else_branch) ) ,
145153 // TODO: can this be `id().map(&[])`?
You can’t perform that action at this time.
0 commit comments