diff --git a/src/protocol/lexer2.rs b/src/protocol/lexer2.rs index 68d39e006e7b820c0aa6e376dff1b21a7d4f3974..50e7ff55cb147ab4c7668d0576badd1e67713cc2 100644 --- a/src/protocol/lexer2.rs +++ b/src/protocol/lexer2.rs @@ -1,4 +1,24 @@ +use crate::protocol::Heap; +use crate::protocol::tokenizer::{TokenBuffer, Token}; +use crate::protocol::input_source2::{InputSource2 as InputSource, ParseError}; -pub struct Lexer<'a> { - source: &'a mut InputSource, +struct Ctx<'a> { + heap: &'a mut Heap, + source: &'a InputSource, + tokens: &'a TokenBuffer, +} + +// Lexes definitions. Should be the first pass over each of the module files +// after tokenization. Only once all definitions are parsed can we do the full +// AST creation pass. +struct LexerDefinitions { + +} + +impl LexerDefinitions { + pub(crate) fn parse(ctx: &mut Ctx) -> Result<(), ParseError> { + debug_assert!(ctx.tokens.ranges.len() > 0); + } + + pub(crate) fn parse_definition(heap: &mut Heap, source: &InputSource, range: &TokenRang) } \ No newline at end of file