yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1// slang-core-diagnostics.cpp 2#include "slang-core-diagnostics.h" 3 4namespace Slang 5{ 6 7namespace MiscDiagnostics 8{ 9#define DIAGNOSTIC (id ,severity ,name ,messageFormat ) \ 10 const DiagnosticInfo name = {id, Severity::severity, #name, messageFormat}; 11#include "slang-misc-diagnostic-defs.h" 12#undef DIAGNOSTIC 13}// namespace MiscDiagnostics 14 15static const DiagnosticInfo * const kMiscDiagnostics []= { 16#define DIAGNOSTIC (id ,severity ,name ,messageFormat )& MiscDiagnostics ::name , 17#include "slang-misc-diagnostic-defs.h" 18#undef DIAGNOSTIC 19}; 20 21 22namespace LexerDiagnostics 23{ 24#define DIAGNOSTIC (id ,severity ,name ,messageFormat ) \ 25 const DiagnosticInfo name = {id, Severity::severity, #name, messageFormat}; 26#include "slang-lexer-diagnostic-defs.h" 27#undef DIAGNOSTIC 28}// namespace LexerDiagnostics 29 30static const DiagnosticInfo * const kLexerDiagnostics []= { 31#define DIAGNOSTIC (id ,severity ,name ,messageFormat )& LexerDiagnostics ::name , 32#include "slang-lexer-diagnostic-defs.h" 33#undef DIAGNOSTIC 34}; 35 36static DiagnosticsLookup * _newCoreDiagnosticsLookup () 37{ 38auto lookup = new DiagnosticsLookup ; 39lookup -> add (kMiscDiagnostics ,SLANG_COUNT_OF (kMiscDiagnostics )); 40lookup -> add (kLexerDiagnostics ,SLANG_COUNT_OF (kLexerDiagnostics )); 41 42return lookup ; 43} 44 45DiagnosticsLookup * getCoreDiagnosticsLookup () 46{ 47static RefPtr < DiagnosticsLookup > s_lookup = _newCoreDiagnosticsLookup (); 48return s_lookup ; 49} 50 51}// namespace Slang