lex things

This commit is contained in:
nora 2022-06-21 13:15:26 +02:00
parent cc8eb57148
commit a5d063b944
7 changed files with 268 additions and 16 deletions

21
parser/src/token.rs Normal file
View 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!())
}