Shader: Add SourceLocation members

TODO: Fill from Parser and use them for error throwing in SanitizeVisitor
This commit is contained in:
SirLynix
2022-03-27 14:06:58 +02:00
committed by Jérôme Leclercq
parent b8bf19f8cd
commit 960ab64d98
15 changed files with 329 additions and 137 deletions

View File

@@ -10,6 +10,7 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Shader/Config.hpp>
#include <Nazara/Shader/ShaderLangParser.hpp>
#include <Nazara/Shader/ShaderLangSourceLocation.hpp>
#include <Nazara/Shader/Ast/Enums.hpp>
#include <exception>
#include <memory>
@@ -18,22 +19,6 @@
namespace Nz::ShaderLang
{
struct SourceLocation
{
inline SourceLocation();
inline SourceLocation(unsigned int line, unsigned int column, std::shared_ptr<const std::string> file);
inline SourceLocation(unsigned int line, unsigned int startColumn, unsigned int endColumn, std::shared_ptr<const std::string> file);
inline SourceLocation(unsigned int startLine, unsigned int endLine, unsigned int startColumn, unsigned int endColumn, std::shared_ptr<const std::string> file);
inline bool IsValid() const;
std::shared_ptr<const std::string> file; //< Since the same file will be used for every node, prevent holding X time the same path
unsigned int endColumn;
unsigned int endLine;
unsigned int startColumn;
unsigned int startLine;
};
enum class ErrorCategory
{
Ast,