preparing to revamp lexer

This commit is contained in:
2025-03-17 01:20:56 -04:00
parent 2ed36506b1
commit 1e7fdcec16
4 changed files with 61 additions and 35 deletions

View File

@ -568,6 +568,23 @@ void lex_found_token( LexContext* ctx )
// TODO(Ed): We need to to attempt to recover from a lex failure?
neverinline
LexedInfo lex_WIP(Context* lib_ctx, Str content)
{
LexedInfo result = struct_zero();
result.text = content;
result.tokens = array_init_reserve(Token, ctx->Allocator_DyanmicContainers, ctx->InitSize_LexerTokens );
LexContext c = struct_zero(); LexContext* ctx = & c;
c.content = content;
c.left = content.Len;
c.scanner = content.Ptr;
return result;
}
neverinline
// void lex( Array<Token> tokens, Str content )
TokArray lex( Str content )