mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-14 16:45:07 +01:00
lex things
This commit is contained in:
parent
cc8eb57148
commit
a5d063b944
7 changed files with 268 additions and 16 deletions
21
parser/src/token.rs
Normal file
21
parser/src/token.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use crate::{
|
||||
pre::{PToken, Punctuator},
|
||||
Span,
|
||||
};
|
||||
|
||||
pub enum Token {
|
||||
Keyword(Keyword),
|
||||
Identifier(),
|
||||
Constant(),
|
||||
StringLiteral(),
|
||||
Punctuator(Punctuator),
|
||||
Error,
|
||||
}
|
||||
|
||||
pub struct Keyword;
|
||||
|
||||
fn from_pre_toks(
|
||||
pre_toks: impl Iterator<Item = (PToken, Span)>,
|
||||
) -> impl IntoIterator<Item = (Token, Span)> {
|
||||
pre_toks.map(|token| todo!())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue