brief-core 0.4.0

Compiler library for the Brief markup language: lexer, parser, AST, HTML/LLM emitters, formatter, and Markdown-to-Brief converter.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::span::Span;

/// Tokens are zero-copy: a `Line` token carries no text of its own. Its
/// `span` points at the trimmed line inside the `SourceMap` the lexer ran
/// over, and consumers slice the text back out via `span.range()`.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TokenKind {
    Line,
    Blank,
    Eof,
}

#[derive(Clone, Copy, Debug)]
pub struct Token {
    pub kind: TokenKind,
    pub span: Span,
    pub indent: u16,
}