yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
eaa8dcfcc
master
1// 2 3// The file is meant to be included multiple times, to produce different 4// pieces of declaration/definition code related to diagnostic messages 5// 6// Each diagnostic is declared here with: 7// 8// DIAGNOSTIC(id, severity, name, messageFormat) 9// 10// Where `id` is the unique diagnostic ID, `severity` is the default 11// severity (from the `Severity` enum), `name` is a name used to refer 12// to this diagnostic from code, and `messageFormat` is the default 13// (non-localized) message for the diagnostic, with placeholders 14// for any arguments. 15 16#ifndef DIAGNOSTIC 17#error Need to #define DIAGNOSTIC(...) before including "slang-cpp-parser/diagnostics-defs.h" 18#define DIAGNOSTIC (id ,severity ,name ,messageFormat )/* */ 19#endif 20 21DIAGNOSTIC (-1 ,Note ,seeDeclarationOf ,"see declaration of '$0'" ) 22DIAGNOSTIC (-1 ,Note ,seeOpen ,"see open $0" ) 23DIAGNOSTIC (-1 ,Note ,commandLine ,"Command line: $0" ) 24DIAGNOSTIC (-1 ,Note ,previousLocation ,"previous location" ) 25 26DIAGNOSTIC (1 ,Error ,cannotOpenFile ,"cannot open file '$0'." ) 27DIAGNOSTIC (1 ,Error ,errorAccessingFile ,"error accessing file '$0'." ) 28 29DIAGNOSTIC (1 ,Error ,extractorFailed ,"C++ Extractor failed" ) 30DIAGNOSTIC (1 ,Error ,internalError ,"Unknown internal error in C++ Extractor, aborted!" ) 31 32// Parsing errors 33DIAGNOSTIC (100000 ,Error ,expectingToken ,"Expecting token $0" ) 34DIAGNOSTIC (100001 ,Error ,typeAlreadyDeclared ,"Type '$0' already declared" ) 35DIAGNOSTIC (100002 ,Error ,scopeNotClosed ,"Scope not closed" ) 36DIAGNOSTIC (100003 ,Error ,typeNameDoesntMatch ,"Type name doesn't match $0" ) 37DIAGNOSTIC (100004 ,Error ,didntFindMatchingBrace ,"Didn't find brace matching $0" ) 38DIAGNOSTIC (100005 ,Error ,braceOpenAtEndOfFile ,"Brace open at file end" ) 39DIAGNOSTIC (100006 ,Error ,unexpectedTemplateClose ,"Unexpected template close" ) 40DIAGNOSTIC (100007 ,Error ,superTypeNotFound ,"Super type not found for $0" ) 41DIAGNOSTIC (100008 ,Error ,superTypeNotAType ,"Named super type is not a type $0" ) 42DIAGNOSTIC (100009 ,Error ,unexpectedUnbalancedToken ,"Unexpected unbalanced token" ) 43DIAGNOSTIC (100010 ,Error ,unexpectedEndOfFile ,"Unexpected end of file" ) 44DIAGNOSTIC ( 45100011 , 46Error , 47expectingTypeKeyword , 48"Expecting type keyword - struct or class, found $0" ) 49 50DIAGNOSTIC ( 51100012 , 52Error , 53typeInDifferentTypeSet , 54"Type $0 in different type set $1 from super class $2" ) 55DIAGNOSTIC (100013 ,Error ,expectingIdentifier ,"Expecting an identifier, found $0" ) 56DIAGNOSTIC (100014 ,Error ,cannotDeclareTypeInScope ,"Cannot declare types in this scope" ) 57DIAGNOSTIC (100015 ,Error ,identifierAlreadyDefined ,"Identifier already defined '$0'" ) 58DIAGNOSTIC (100016 ,Error ,expectingType ,"Expecting a type" ) 59DIAGNOSTIC (100017 ,Error ,cannotParseExpression ,"Cannot parse expression" ) 60DIAGNOSTIC (100018 ,Error ,cannotOverload ,"Cannot overload this declaration" ); 61DIAGNOSTIC ( 62100019 , 63Error , 64classMarkerOutsideOfClass , 65"A class/struct marker is found outside of class or struct" ); 66DIAGNOSTIC ( 67100020 , 68Error , 69classMarkerAlreadyFound , 70"A class/struct marker already found in type '$0'" ); 71DIAGNOSTIC (100021 ,Error ,cannotParseType ,"Cannot parse type" ); 72DIAGNOSTIC ( 73100022 , 74Error , 75destructorNameDoesntMatch , 76"Destructor name doesn't match class name '$0'" ); 77DIAGNOSTIC (100023 ,Error ,cannotParseCallable ,"Cannot parse callable" ); 78DIAGNOSTIC ( 79100024 , 80Error , 81cannoseUseArchDependentType , 82"Cannot use architecture dependent type '$0' for serializable data." ) 83 84// Command line errors 100100 85 86DIAGNOSTIC (100101 ,Error ,optionAlreadyDefined ,"Option '$0' is already defined '$1'" ) 87DIAGNOSTIC (100102 ,Error ,requireValueAfterOption ,"Require a value after $0 option" ) 88DIAGNOSTIC (100103 ,Error ,unknownOption ,"Unknown option '$0'" ) 89DIAGNOSTIC (100104 ,Error ,noInputPathsSpecified ,"No input paths specified" ) 90DIAGNOSTIC (100105 ,Error ,noOutputPathSpecified ,"No -o output path specified" ) 91 92#undef DIAGNOSTIC