mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Lexing updated with simpler code. Note: may have bugs.
This commit is contained in:
committed by
Christoffer Lerno
parent
0a9a014e4a
commit
a0be188902
@@ -1247,15 +1247,16 @@ static Expr *parse_bytes_expr(Context *context, Expr *left)
|
||||
{
|
||||
TokenData *token_data = tokendata_from_token(context->lex.tok);
|
||||
SourceLocation *loc = TOKLOC(context->lex.tok);
|
||||
File *file = source_file_by_id(loc->file_id);
|
||||
if (token_data->is_base64)
|
||||
{
|
||||
const char *base64data = &loc->file->contents[loc->start] + 4;
|
||||
const char *base64data = &file->contents[loc->start] + 4;
|
||||
const char *end = base64data + loc->length - 1;
|
||||
parse_base64(&data_current, data_current + token_data->len, base64data, end);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *hexdata = &loc->file->contents[loc->start] + 2;
|
||||
const char *hexdata = &file->contents[loc->start] + 2;
|
||||
const char *end = hexdata + loc->length - 1;
|
||||
parse_hex(&data_current, hexdata, end);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user