Shader: Add SourceLocation members
TODO: Fill from Parser and use them for error throwing in SanitizeVisitor
This commit is contained in:
committed by
Jérôme Leclercq
parent
b8bf19f8cd
commit
960ab64d98
51
include/Nazara/Shader/ShaderLangSourceLocation.inl
Normal file
51
include/Nazara/Shader/ShaderLangSourceLocation.inl
Normal file
@@ -0,0 +1,51 @@
|
||||
// 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
|
||||
|
||||
#include <Nazara/Shader/ShaderLangSourceLocation.hpp>
|
||||
#include <Nazara/Shader/Debug.hpp>
|
||||
|
||||
namespace Nz::ShaderLang
|
||||
{
|
||||
inline SourceLocation::SourceLocation() :
|
||||
endColumn(0),
|
||||
endLine(0),
|
||||
startColumn(0),
|
||||
startLine(0)
|
||||
{
|
||||
}
|
||||
|
||||
inline SourceLocation::SourceLocation(unsigned int Line, unsigned int Column, std::shared_ptr<const std::string> File) :
|
||||
file(std::move(File)),
|
||||
endColumn(Column),
|
||||
endLine(Line),
|
||||
startColumn(Column),
|
||||
startLine(Line)
|
||||
{
|
||||
}
|
||||
|
||||
inline SourceLocation::SourceLocation(unsigned int Line, unsigned int StartColumn, unsigned int EndColumn, std::shared_ptr<const std::string> File) :
|
||||
file(std::move(File)),
|
||||
endColumn(EndColumn),
|
||||
endLine(Line),
|
||||
startColumn(StartColumn),
|
||||
startLine(Line)
|
||||
{
|
||||
}
|
||||
|
||||
inline SourceLocation::SourceLocation(unsigned int StartLine, unsigned int EndLine, unsigned int StartColumn, unsigned int EndColumn, std::shared_ptr<const std::string> File) :
|
||||
file(std::move(File)),
|
||||
endColumn(EndColumn),
|
||||
endLine(EndLine),
|
||||
startColumn(StartColumn),
|
||||
startLine(StartLine)
|
||||
{
|
||||
}
|
||||
|
||||
inline bool SourceLocation::IsValid() const
|
||||
{
|
||||
return startLine != 0 && endLine != 0 && endColumn != 0 && startColumn != 0;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Shader/DebugOff.hpp>
|
||||
Reference in New Issue
Block a user