// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Shader module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_SHADER_SHADERLANGSOURCELOCATION_HPP #define NAZARA_SHADER_SHADERLANGSOURCELOCATION_HPP #include #include #include #include namespace Nz::ShaderLang { struct SourceLocation { inline SourceLocation(); inline SourceLocation(unsigned int line, unsigned int column, std::shared_ptr file); inline SourceLocation(unsigned int line, unsigned int startColumn, unsigned int endColumn, std::shared_ptr file); inline SourceLocation(unsigned int startLine, unsigned int endLine, unsigned int startColumn, unsigned int endColumn, std::shared_ptr file); inline void ExtendToLeft(const SourceLocation& leftLocation); inline void ExtendToRight(const SourceLocation& rightLocation); inline bool IsValid() const; static inline SourceLocation BuildFromTo(const SourceLocation& leftSource, const SourceLocation& rightSource); std::shared_ptr file; //< Since the same file will be used for every node, prevent storing X time the same path UInt32 endColumn; UInt32 endLine; UInt32 startColumn; UInt32 startLine; }; } #include #endif // NAZARA_SHADER_SHADERLANGSOURCELOCATION_HPP