summaryrefslogtreecommitdiffstats
path: root/crates/rebel-parse/src/token.rs
blob: 5e6b7419223c8a40f495276ddd7d6fea105eb641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Token<'a> {
	Ident(&'a str),
	Punct(Punct),
	String(String<'a>),
	Number(&'a str),
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Punct(pub char, pub Spacing);

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Spacing {
	Alone,
	Joint,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct String<'a> {
	pub content: &'a str,
	pub kind: StringKind,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum StringKind {
	String,
	RawString,
	ScriptString,
}