Improved logging

Small errors with logging parser unexpected token errors. Tokens need to be re-written with how they store memory as it can be halved.
This commit is contained in:
Pasha Bibko
2025-04-22 00:16:20 +01:00
parent a1e812efc2
commit 4b47e803ce
11 changed files with 201 additions and 124 deletions

View File

@@ -6,7 +6,7 @@
namespace LX
{
// Passes the constructor args to the values //
Token::Token(const TokenType _type, std::string _contents, std::streamsize _line, std::streamsize _index, std::streamsize _length)
: type(_type), contents(_contents), line(_line), index(_index), length(_length)
Token::Token(const TokenType _type, const LexerInfo& info, std::string _contents, std::streamsize _length)
: type(_type), contents(_contents), index(info.index - _length + 1), line(info.line), column(info.column - _length), length(_length)
{}
}