mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-07 04:06:48 +01:00
wip: dsl: continuing to offload to Ast
This commit is contained in:
parent
e9d4c7e0bc
commit
08a8dff93d
4 changed files with 19 additions and 20 deletions
|
|
@ -1,13 +1,12 @@
|
|||
use crate::*;
|
||||
|
||||
/// Keeps the reference to the source slice.
|
||||
/// CST stores strings as source references and expressions as new [SourceIter] instances.
|
||||
pub type CstValue<'source> = Value<&'source str, SourceIter<'source>>;
|
||||
/// Token sharing memory with source reference.
|
||||
#[derive(Debug, Copy, Clone, Default, PartialEq)]
|
||||
pub struct CstToken<'source>(pub CstValue<'source>, pub CstMeta<'source>);
|
||||
|
||||
/// Reference to the source slice.
|
||||
#[derive(Debug, Copy, Clone, Default, PartialEq)] pub struct CstMeta<'source> {
|
||||
pub source: &'source str,
|
||||
pub start: usize,
|
||||
pub length: usize,
|
||||
}
|
||||
|
||||
pub type CstValue<'source> = Value<&'source str, SourceIter<'source>>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue