Files
MIRROR-LX-OriginalRepo/Lexer/src/Token.cpp
Pasha Bibko 4e78a9f6ae Made Lexer errors fully hidden in global scope
Also improved general ease of use with debugging use __debugbreak when an error is thrown.

NOTE: Parser errors currently crash the program
2025-05-07 16:31:44 +01:00

21 lines
547 B
C++

#include <LX-Common.h>
#include <Lexer.h>
#include <LexerInfo.h>
namespace LX
{
// Passes the constructor args to the values //
Token::Token(const TokenType _type, const LexerInfo& info, std::streamsize _length, const std::string& source)
: type(_type), index(info.index - _length + 1), line(info.line), column(info.column - _length), length(_length), contents(source.data() + index, length)
{}
// This function used to have a use //
// Now it exists cause I'm lazy //
std::string Token::GetContents() const
{
return contents;
}
}