pub fn can_exec(insts: &Program) -> bool {
    use prog::Inst::*;
    use prog::EmptyLook::*;
    // If for some reason we manage to allocate a regex program with more
    // than 2^32-1 instructions, then we can't execute the DFA because we
    // use 32 bit pointers.
    if insts.len() > ::std::u32::MAX as usize {
        return false;
    }
    for inst in insts {
        match *inst {
            Char(_) | Ranges(_) => return false,
            EmptyLook(ref inst) => {
                match inst.look {
                    WordBoundary | NotWordBoundary => return false,
                    WordBoundaryAscii | NotWordBoundaryAscii => {}
                    StartLine | EndLine | StartText | EndText => {}
                }
            }
            Match(_) | Save(_) | Split(_) | Bytes(_) => {}
        }
    }
    true
}
/// Return true if and only if the given program can be executed by a DFA.
///
/// Generally, a DFA is possible only when there are no word boundary
/// assertions. This is due to the difficulty (but likely not impossibility)
/// of tracking multi-byte assertions in the DFA.
Return true if and only if the given program can be executed by a DFA.
Generally, a DFA is possible only when there are no word boundary
assertions. This is due to the difficulty (but likely not impossibility)
of tracking multi-byte assertions in the DFA.
Return true if and only if the given program can be executed by a DFA . Generally a DFA is possible only when there are no word boundary assertions . This is due to the difficulty ( but likely not impossibility ) of tracking multi - byte assertions in the DFA .
pub fn can_exec(insts: &Program) -> bool {
    use prog::Inst::*;
    use prog::EmptyLook::*;
    // If for some reason we manage to allocate a regex program with more
    // than 2^32-1 instructions, then we can't execute the DFA because we
    // use 32 bit pointers.
    if insts.len() > ::std::u32::MAX as usize {
        return false;
    }
    for inst in insts {
        match *inst {
            Char(_) | Ranges(_) => return false,
            EmptyLook(ref inst) => {
                match inst.look {
                    WordBoundary | NotWordBoundary => return false,
                    WordBoundaryAscii | NotWordBoundaryAscii => {}
                    StartLine | EndLine | StartText | EndText => {}
                }
            }
            Match(_) | Save(_) | Split(_) | Bytes(_) => {}
        }
    }
    true
}
pub fn can_exec ( insts : & Program ) -> bool { use prog :: Inst :: * ; use prog :: EmptyLook :: * ; // If for some reason we manage to allocate a regex program with more // than 2^32-1 instructions, then we can't execute the DFA because we // use 32 bit pointers. if insts . len ( ) > :: std :: u32 :: MAX as usize { return false ; } for inst in insts { match * inst { Char ( _ ) | Ranges ( _ ) => return false , EmptyLook ( ref inst ) => { match inst . look { WordBoundary | NotWordBoundary => return false , WordBoundaryAscii | NotWordBoundaryAscii => { } StartLine | EndLine | StartText | EndText => { } } } Match ( _ ) | Save ( _ ) | Split ( _ ) | Bytes ( _ ) => { } } } true }
Return true if and only if the given program can be executed by a DFA.
Return true if and only if the given program can be executed by a DFA .
insts
&Program
insts
&Program