mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
This commit is contained in:
parent
21832453d9
commit
17506726cb
36 changed files with 280 additions and 271 deletions
|
|
@ -3,6 +3,10 @@ use crate::*;
|
|||
/// 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,
|
||||
|
|
@ -10,10 +14,6 @@ pub type CstValue<'source> = Value<&'source str, SourceIter<'source>>;
|
|||
pub length: usize,
|
||||
}
|
||||
|
||||
/// Token sharing memory with source reference.
|
||||
#[derive(Debug, Copy, Clone, Default, PartialEq)]
|
||||
pub struct CstToken<'source>(pub CstValue<'source>, pub CstMeta<'source>);
|
||||
|
||||
impl<'source> CstToken<'source> {
|
||||
pub const fn new (
|
||||
source: &'source str, start: usize, length: usize, value: CstValue<'source>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue