pluto-src 0.1.1+0.10.4

Sources of Pluto (Lua 5.4 dialect) and logic to build it.
Documentation
#pragma once

#include <string>
#include <vector>

#include "fwd.hpp"
#include "Lexeme.hpp"

NAMESPACE_SOUP
{
	struct LexemeParser
	{
		std::vector<Lexeme> tks;
		std::vector<Lexeme>::iterator i;

		explicit LexemeParser(const LangDesc& ld, const std::string& code);
		explicit LexemeParser(std::vector<Lexeme>&& tks);

		[[nodiscard]] bool hasMore() const noexcept
		{
			return tks.end() != i;
		}

		[[nodiscard]] const char* getTokenKeyword() const noexcept
		{
			if (hasMore())
			{
				return i->token_keyword;
			}
			return nullptr;
		}

		void advance() noexcept
		{
			++i;
		}
	};
}