refactor: start to stop using ctx.Match

This commit is contained in:
dusk 2025-01-05 00:58:48 +09:00
parent b89bc44a27
commit e70d69e45c
No known key found for this signature in database
6 changed files with 56 additions and 35 deletions

View file

@ -22,7 +22,7 @@ use smol_str::SmolStr;
use crate::{command, token::Token};
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct Command {
// TODO: fix hygiene
pub tokens: Vec<Token>,

View file

@ -1 +1,10 @@
use super::*;
pub fn cmds() -> impl Iterator<Item = Command> {
[command!(
[Token::cmd("thunder")],
"fun_thunder",
"Shows the help command"
)]
.into_iter()
}

View file

@ -1,6 +1,6 @@
#![feature(let_chains)]
mod commands;
pub mod commands;
mod string;
mod token;
mod tree;
@ -17,7 +17,7 @@ pub use commands::Command;
pub use token::*;
lazy_static::lazy_static! {
static ref COMMAND_TREE: TreeBranch = {
pub static ref COMMAND_TREE: TreeBranch = {
let mut tree = TreeBranch {
current_command_key: None,
possible_tokens: vec![],