fn opcode(input: &str) -> ParseResult<&str> {
    let (input, _) = space0(input)?;
    let (input, op) = alt((
        tag("refer"),
        tag("deref_ld"),
        tag("deref_st"),
        tag("free"),
        tag("alloc"),
        tag("ld"),
        tag("st"),
        tag("push"),
        tag("pop"),
        tag("dup"),
        tag("add"),
        // a second alt must be added because the number of arguments
        // is too large for a single call to alt
        alt((
            tag("inc"),
            tag("inn"),
            tag("sub"),
            tag("mul"),
            tag("div"),
            tag("outc"),
            tag("outn"),
            tag("cmp"),
            tag("loop"),
            tag("call"),
            tag("define"),
            tag("endloop"),
        )),
    ))(input)?;
    let (input, _) = space0(input)?;
    Ok((input, op))
}
/// This parser parses lasm's opcodes
This parser parses lasm's opcodes
This parser parses lasm ' s opcodes
fn opcode(input: &str) -> ParseResult<&str> {
    let (input, _) = space0(input)?;
    let (input, op) = alt((
        tag("refer"),
        tag("deref_ld"),
        tag("deref_st"),
        tag("free"),
        tag("alloc"),
        tag("ld"),
        tag("st"),
        tag("push"),
        tag("pop"),
        tag("dup"),
        tag("add"),
        // a second alt must be added because the number of arguments
        // is too large for a single call to alt
        alt((
            tag("inc"),
            tag("inn"),
            tag("sub"),
            tag("mul"),
            tag("div"),
            tag("outc"),
            tag("outn"),
            tag("cmp"),
            tag("loop"),
            tag("call"),
            tag("define"),
            tag("endloop"),
        )),
    ))(input)?;
    let (input, _) = space0(input)?;
    Ok((input, op))
}
fn opcode ( input : & str ) -> ParseResult < & str > { let ( input , _ ) = space0 ( input ) ? ; let ( input , op ) = alt ( ( tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , // a second alt must be added because the number of arguments // is too large for a single call to alt alt ( ( tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , tag ( " " ) , ) ) , ) ) ( input ) ? ; let ( input , _ ) = space0 ( input ) ? ; Ok ( ( input , op ) ) }
This parser parses lasm's opcodes
This parser parses lasm ' s opcodes
input
&str
input
&str