sipha-core 0.3.0

Core foundation types and traits for sipha - minimal dependencies, no parsing logic
Documentation
# sipha-core

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Repository](https://img.shields.io/badge/github-sipha-blue)](https://github.com/NyalephTheCat/sipha)
[![Crates.io](https://img.shields.io/crates/v/sipha-core)](https://crates.io/crates/sipha-core)
[![docs.rs](https://docs.rs/sipha-core/badge.svg)](https://docs.rs/sipha-core)

Core foundation types and traits for sipha - minimal dependencies, no parsing logic.

## Overview

`sipha-core` is the minimal foundation of the sipha parser ecosystem. It provides only the essential traits and types that are shared across all other `sipha` crates:

- **Core traits**: `TokenKind`, `RuleId`, `NodeId`, `SymbolId`, `GrammarContext`, `AstNode`
- **Basic types**: `Span`, `Token`, `TokenTrivia`

This crate has minimal dependencies and contains no parsing logic, focusing solely on defining the interfaces for tokens, rules, nodes, and spans.

## Quick Start

Add `sipha-core` to your `Cargo.toml`:

```toml
[dependencies]
sipha-core = "0.1.1"
```

With optional features:

```toml
[dependencies]
sipha-core = { version = "0.1.1", features = ["serde"] }
```

## Features

- `default`: No features enabled (minimal dependencies)
- `serde`: Enables serialization/deserialization for `Span` and `Token`

## Example

```rust
use sipha_core::traits::{TokenKind, RuleId, NodeId};
use sipha_core::span::Span;
use sipha_core::token::Token;

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum MyToken {
    Ident,
    Number,
}

impl TokenKind for MyToken {
    fn is_trivia(&self) -> bool {
        false
    }
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum MyRule {
    Expression,
    Term,
}

impl RuleId for MyRule {}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct MyNodeId(usize);

impl NodeId for MyNodeId {
    fn from_raw(raw: usize) -> Self {
        MyNodeId(raw)
    }
    fn to_raw(self) -> usize {
        self.0
    }
}
```

## Documentation

For more information, see:
- [Architecture Guide]https://github.com/NyalephTheCat/sipha/blob/release/docs/concepts/architecture.md
- [Main README]https://github.com/NyalephTheCat/sipha/blob/release/README.md

## License

This project is licensed under the MIT License - see the [LICENSE](../LICENSE) file for details.

## See Also

- [sipha]https://crates.io/crates/sipha - Umbrella crate with feature flags
- [sipha-tree]../sipha-tree - CST/AST construction
- [sipha-parse]../sipha-parse - Parsing engine
- [sipha-error]../sipha-error - Error handling