yum-mirror/slang

Making it easier to work with shaders

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

Ellie Hermaszewskaformatf65d756bf

master
1.8 KiB62 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
18#define DIAGNOSTIC(id, severity, name, messageFormat) /* */
19#endif
20
21//
22// -1 - Notes that decorate another diagnostic.
23//
24
25DIAGNOSTIC(-1, Note, seeTokenPasteLocation, "see token pasted location")
26
27DIAGNOSTIC(
28    100000,
29    Error,
30    downstreamNameNotKnown,
31    "downstream tool name not known, allowed names are $0")
32DIAGNOSTIC(
33    100001,
34    Error,
35    expectedArgumentForOption,
36    "expected an argument for command-line option '$0'")
37DIAGNOSTIC(100002, Error, unbalancedDownstreamArguments, "unbalanced downstream arguments")
38DIAGNOSTIC(
39    100003,
40    Error,
41    closeOfUnopenDownstreamArgs,
42    "close of an unopen downstream argument scope")
43DIAGNOSTIC(100004, Error, downstreamToolNameNotDefined, "downstream tool name not defined")
44DIAGNOSTIC(
45    100005,
46    Error,
47    invalidArgumentForOption,
48    "invalid argument format for command-line option '$0'")
49
50DIAGNOSTIC(
51    99999,
52    Note,
53    noteLocationOfInternalError,
54    "an internal error threw an exception while working on code near this location")
55
56DIAGNOSTIC(
57    29104,
58    Error,
59    spirvCoreGrammarJSONParseFailure,
60    "unexpected JSON in spirv core grammar file: $0")
61
62#undef DIAGNOSTIC