fn parse_word_decl(tokens: &[&str]) -> FResult<Stmt> {
    if tokens.is_empty() {
        return Err(Error::InvalidWord);
    }

    let (hd, tl) = tokens.split_at(1);
    let name = hd[0];
    if str::parse::<Value>(name).is_ok() {
        return Err(Error::InvalidWord);
    }
    Ok(Stmt::WordDef {
        name: name.to_lowercase(),
        body: tl.iter().map(|tok| parse_instr(tok)).collect(),
    })
}
/// Parses a slice representing a word declaration without the surrounding ':' and ';'.
Parses a slice representing a word declaration without the surrounding ':' and ';'.
Parses a slice representing a word declaration without the surrounding ' : ' and ' ; ' .
fn parse_word_decl(tokens: &[&str]) -> FResult<Stmt> {
    if tokens.is_empty() {
        return Err(Error::InvalidWord);
    }
    let (hd, tl) = tokens.split_at(1);
    let name = hd[0];
    if str::parse::<Value>(name).is_ok() {
        return Err(Error::InvalidWord);
    }
    Ok(Stmt::WordDef {
        name: name.to_lowercase(),
        body: tl.iter().map(|tok| parse_instr(tok)).collect(),
    })
}
fn parse_word_decl ( tokens : & [ & str ] ) -> FResult < Stmt > { if tokens . is_empty ( ) { return Err ( Error :: InvalidWord ) ; } let ( hd , tl ) = tokens . split_at ( 1 ) ; let name = hd [ 0 ] ; if str :: parse :: < Value > ( name ) . is_ok ( ) { return Err ( Error :: InvalidWord ) ; } Ok ( Stmt :: WordDef { name : name . to_lowercase ( ) , body : tl . iter ( ) . map ( | tok | parse_instr ( tok ) ) . collect ( ) , } ) }
Parses a slice representing a word declaration without the surrounding ':' and ';'.
Parses a slice representing a word declaration without the surrounding ' : ' and ' ; ' .
tokens
&[&str]
tokens
&[&str]