Shader: Fill SourceLocation info to AST when parsing

This commit is contained in:
SirLynix
2022-03-28 18:24:51 +02:00
committed by Jérôme Leclercq
parent 8429411755
commit 78f4751967
10 changed files with 339 additions and 173 deletions

View File

@@ -21,8 +21,13 @@ namespace Nz::ShaderLang
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 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<const std::string> file; //< Since the same file will be used for every node, prevent holding X time the same path
UInt32 endColumn;
UInt32 endLine;