yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1// slang-artifact-diagnostic-util.h 2#ifndef SLANG_ARTIFACT_DIAGNOSTIC_UTIL_H 3#define SLANG_ARTIFACT_DIAGNOSTIC_UTIL_H 4 5#include "slang-artifact-associated.h" 6#include "slang-artifact.h" 7#include "slang-slice-allocator.h" 8 9namespace Slang 10{ 11 12struct ArtifactDiagnosticUtil 13{ 14typedef ArtifactDiagnostic ::Severity Severity ; 15 16/// Given severity return as text 17static UnownedStringSlice getSeverityText (Severity severity ); 18 19/// Given a path, that holds line number and potentially column number in () after path, writes 20/// result into outDiagnostic 21static SlangResult splitPathLocation ( 22SliceAllocator & allocator , 23const UnownedStringSlice & pathLocation , 24ArtifactDiagnostic & outDiagnostic ); 25 26/// Split the line (separated by :), where a path is at pathIndex 27static SlangResult splitColonDelimitedLine ( 28const UnownedStringSlice & line , 29Int pathIndex , 30List < UnownedStringSlice >& outSlices ); 31 32typedef SlangResult (* LineParser )( 33SliceAllocator & allocator , 34const UnownedStringSlice & line , 35List < UnownedStringSlice >& lineSlices , 36ArtifactDiagnostic & outDiagnostic ); 37 38/// Given diagnostics in inText that are colon delimited, use lineParser to do per line parsing. 39static SlangResult parseColonDelimitedDiagnostics ( 40SliceAllocator & allocator , 41const UnownedStringSlice & inText , 42Int pathIndex , 43LineParser lineParser , 44IArtifactDiagnostics * diagnostics ); 45 46/// Maybe add a note 47static void maybeAddNote (const UnownedStringSlice & in ,IArtifactDiagnostics * diagnostics ); 48}; 49 50}// namespace Slang 51 52#endif