dust/src/abstract_tree/command.rs

31 lines
805 B
Rust
Raw Normal View History

2024-01-25 13:27:24 +00:00
use serde::{Deserialize, Serialize};
2024-01-25 12:10:45 +00:00
2024-01-25 13:27:24 +00:00
use crate::{AbstractTree, Error, Format, Identifier, Map, Result, Type, Value};
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, PartialOrd, Ord)]
2024-01-25 12:10:45 +00:00
pub struct Command {
binary_name: String,
arguments: Vec<String>,
}
impl AbstractTree for Command {
2024-01-25 13:27:24 +00:00
fn from_syntax(node: tree_sitter::Node, source: &str, context: &crate::Map) -> Result<Self> {
Error::expect_syntax_node(source, "command", node)?;
let identifier_node = node.child(1)
2024-01-25 12:10:45 +00:00
}
2024-01-25 13:27:24 +00:00
fn run(&self, source: &str, context: &Map) -> Result<Value> {
2024-01-25 12:10:45 +00:00
todo!()
}
2024-01-25 13:27:24 +00:00
fn expected_type(&self, context: &Map) -> Result<Type> {
2024-01-25 12:10:45 +00:00
todo!()
}
}
impl Format for Command {
fn format(&self, output: &mut String, indent_level: u8) {
todo!()
}
}