fn keyword(identifier: &str) -> Option<TokenKind> {
      Some(match identifier {
         "nil" => TokenKind::Nil,
         "true" => TokenKind::True,
         "false" => TokenKind::False,

         "and" => TokenKind::And,
         "or" => TokenKind::Or,

         "do" => TokenKind::Do,
         "if" => TokenKind::If,
         "elif" => TokenKind::Elif,
         "else" => TokenKind::Else,
         "while" => TokenKind::While,
         "func" => TokenKind::Func,
         "end" => TokenKind::End,
         "break" => TokenKind::Break,
         "return" => TokenKind::Return,

         "struct" => TokenKind::Struct,
         "impl" => TokenKind::Impl,
         "constructor" => TokenKind::Constructor,
         "static" => TokenKind::Static,

         _ => return None,
      })
   }
/// Returns which keyword this identifier corresponds to, or `None` if the identifier is not
/// reserved.
Returns which keyword this identifier corresponds to, or `None` if the identifier is not
reserved.
Returns which keyword this identifier corresponds to or ` None ` if the identifier is not reserved .
fn keyword(identifier: &str) -> Option<TokenKind> {
      Some(match identifier {
         "nil" => TokenKind::Nil,
         "true" => TokenKind::True,
         "false" => TokenKind::False,
         "and" => TokenKind::And,
         "or" => TokenKind::Or,
         "do" => TokenKind::Do,
         "if" => TokenKind::If,
         "elif" => TokenKind::Elif,
         "else" => TokenKind::Else,
         "while" => TokenKind::While,
         "func" => TokenKind::Func,
         "end" => TokenKind::End,
         "break" => TokenKind::Break,
         "return" => TokenKind::Return,
         "struct" => TokenKind::Struct,
         "impl" => TokenKind::Impl,
         "constructor" => TokenKind::Constructor,
         "static" => TokenKind::Static,
         _ => return None,
      })
   }
fn keyword ( identifier : & str ) -> Option < TokenKind > { Some ( match identifier { " " => TokenKind :: Nil , " " => TokenKind :: True , " " => TokenKind :: False , " " => TokenKind :: And , " " => TokenKind :: Or , " " => TokenKind :: Do , " " => TokenKind :: If , " " => TokenKind :: Elif , " " => TokenKind :: Else , " " => TokenKind :: While , " " => TokenKind :: Func , " " => TokenKind :: End , " " => TokenKind :: Break , " " => TokenKind :: Return , " " => TokenKind :: Struct , " " => TokenKind :: Impl , " " => TokenKind :: Constructor , " " => TokenKind :: Static , _ => return None , } ) }
Returns which keyword this identifier corresponds to, or `None` if the identifier is not
reserved.
Returns which keyword this identifier corresponds to or ` None ` if the identifier is not reserved .
identifier
&str