yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie Hermaszewskaformatf65d756bf

master
3.4 KiB90 linesraw
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 "DiagnosticDefs.h"
18#define DIAGNOSTIC(id, severity, name, messageFormat) /* */
19#endif
20
21//
22// -1 - Notes that decorate another diagnostic.
23//
24
25DIAGNOSTIC(-1, Note, seeDefinitionOf, "see definition of '$0'")
26
27//
28// 0xxxx -  Command line and interaction with host platform APIs.
29//
30
31DIAGNOSTIC(1, Error, cannotOpenFile, "cannot open file '$0'.")
32DIAGNOSTIC(2, Error, cannotFindFile, "cannot find file '$0'.")
33DIAGNOSTIC(4, Error, cannotWriteOutputFile, "cannot write output file '$0'.")
34DIAGNOSTIC(5, Error, failedToLoadDynamicLibrary, "failed to load dynamic library '$0'")
35DIAGNOSTIC(
36    6,
37    Error,
38    tooManyOutputPathsSpecified,
39    "$0 output paths specified, but only $1 entry points given")
40DIAGNOSTIC(
41    7,
42    Warning,
43    couldNotFindValidDocumentationOutputPath,
44    "could not find valid documentation output path at $0")
45
46//
47// 2xxxx - Parsing
48//
49
50DIAGNOSTIC(20003, Error, unexpectedToken, "unexpected $0")
51DIAGNOSTIC(20001, Error, unexpectedTokenExpectedTokenType, "unexpected $0, expected $1")
52DIAGNOSTIC(20001, Error, unexpectedTokenExpectedTokenName, "unexpected $0, expected '$1'")
53DIAGNOSTIC(20004, Warning, requiresDocComment, "'$0' requires a documentation comment \"///\"")
54DIAGNOSTIC(
55    20004,
56    Warning,
57    invalidDocCommentHeader,
58    "got documentation comment '[$0]', expected one of: [Target] [Stage] [EXT] [Version] "
59    "[Compound] [Other]")
60
61DIAGNOSTIC(0, Error, tokenNameExpectedButEOF, "\"$0\" expected but end of file encountered.")
62DIAGNOSTIC(0, Error, tokenTypeExpectedButEOF, "$0 expected but end of file encountered.")
63DIAGNOSTIC(20001, Error, tokenNameExpected, "\"$0\" expected")
64DIAGNOSTIC(20001, Error, tokenNameExpectedButEOF2, "\"$0\" expected but end of file encountered.")
65DIAGNOSTIC(20001, Error, tokenTypeExpected, "$0 expected")
66DIAGNOSTIC(20001, Error, tokenTypeExpectedButEOF2, "$0 expected but end of file encountered.")
67DIAGNOSTIC(20001, Error, typeNameExpectedBut, "unexpected $0, expected type name")
68DIAGNOSTIC(20001, Error, typeNameExpectedButEOF, "type name expected but end of file encountered.")
69DIAGNOSTIC(20001, Error, unexpectedEOF, " Unexpected end of file.")
70DIAGNOSTIC(20002, Error, syntaxError, "syntax error.")
71DIAGNOSTIC(20003, Error, undefinedIdentifier, "undefined identifier \"$0\".")
72DIAGNOSTIC(20004, Error, redefinition, "capability redefinition: '$0'.")
73DIAGNOSTIC(
74    20005,
75    Error,
76    unionWithSameKeyAtomButNotSubset,
77    "unioning ('|') capability sets which have incompatible atoms but compatible 'key atoms', "
78    "this: '$0', other: '$1'")
79DIAGNOSTIC(
80    20006,
81    Error,
82    invalidJoinInGenerator,
83    "joining ('+') capability sets which have incompatible 'key atoms'")
84DIAGNOSTIC(
85    20007,
86    Error,
87    missingExternalInternalAtomPair,
88    "All internal '_atom' require a corresponding external 'atom' atom meant for user's use. "
89    "Offending atom: $0")
90#undef DIAGNOSTIC