mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-03 17:39:02 +00:00
Also improved general ease of use with debugging use __debugbreak when an error is thrown. NOTE: Parser errors currently crash the program
21 lines
547 B
C++
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;
|
|
}
|
|
}
|