aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/context/parsed_command_node.rs
blob: 98e9995902593932bf89cff2794a9e59331088b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::string_range::StringRange;
use crate::tree::command_node::CommandNode;

#[derive(Hash, PartialEq, Eq, Debug, Clone)]
pub struct ParsedCommandNode<S> {
    node: dyn CommandNode<S>,
    range: StringRange,
}

impl<S> ParsedCommandNode<S> {
    fn new(node: dyn CommandNode<S>, range: StringRange) -> Self {
        Self { node, range }
    }

    fn node(&self) -> &dyn CommandNode<S> {
        &self.node
    }

    fn range(&self) -> &StringRange {
        &self.range
    }
}