Skip to main content

brief/
token.rs

1use crate::span::Span;
2
3/// Tokens are zero-copy: a `Line` token carries no text of its own. Its
4/// `span` points at the trimmed line inside the `SourceMap` the lexer ran
5/// over, and consumers slice the text back out via `span.range()`.
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum TokenKind {
8    Line,
9    Blank,
10    Eof,
11}
12
13#[derive(Clone, Copy, Debug)]
14pub struct Token {
15    pub kind: TokenKind,
16    pub span: Span,
17    pub indent: u16,
18}