fluidattacks-blends-domain 0.2.0

Blends functional core: pure AST graph to syntax graph (no_std)
Documentation
//! Blends functional core: the pure AST graph to syntax graph transformation.
//!
//! Everything here is `no_std` + (later) `alloc` — no filesystem, network,
//! clock, randomness, or tree-sitter. The imperative shell (`crates/shell`)
//! parses source into an AST graph and feeds it in; this crate only decides how
//! that graph becomes a syntax graph.
#![cfg_attr(not(test), no_std)]

extern crate alloc;

use alloc::vec::Vec;

pub mod ast;
pub mod content;
pub mod graph_set;
pub mod language;
pub mod path_search;
pub mod query;
pub mod syntax;
pub(crate) mod utilities;

pub use language::Language;

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct NodeId(pub u64);

#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct Ast;

#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct Cfg;

pub trait CodeGraph {
    fn children(&self, n_id: NodeId) -> Vec<NodeId>;
    fn parents(&self, n_id: NodeId) -> Vec<NodeId>;
    fn ast_children(&self, n_id: NodeId) -> Vec<NodeId>;
    fn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>;
    fn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>;
    fn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>;
    fn label_type(&self, n_id: NodeId) -> Option<&str>;
}