yum-mirror/slang

Making it easier to work with shaders

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

Theresa FoleyAdd support for on-demand AST deserialization (#7482)3ed776159

master
2.3 KiB78 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 "slang-cpp-parser/diagnostics-defs.h"
18#define DIAGNOSTIC(id, severity, name, messageFormat) /* */
19#endif
20
21#if 0
22DIAGNOSTIC(-1, Note, seeDeclarationOf, "see declaration of '$0'")
23DIAGNOSTIC(-1, Note, seeOpen, "see open $0")
24DIAGNOSTIC(-1, Note, commandLine, "Command line: $0")
25DIAGNOSTIC(-1, Note, previousLocation, "previous location")
26#endif
27
28// Command Line
29
30DIAGNOSTIC(100001, Error, unknownOption, "unknown option '$0'")
31
32// Basic I/O
33
34DIAGNOSTIC(200001, Error, couldNotReadInputFile, "could not read input file '$0'")
35DIAGNOSTIC(200002, Error, couldNotOverwriteInputFile, "could not overwrite input file '$0'")
36DIAGNOSTIC(200002, Error, couldNotWriteOutputFile, "could not write output file '$0'")
37
38// Template Parsing
39
40DIAGNOSTIC(
41    300001,
42    Error,
43    expectedOutputStartMarker,
44    "start line for template not followed by a line marking output with '$0'")
45DIAGNOSTIC(300002, Error, expectedEndMarker, "expected a template end line ('$0')")
46
47// Template Lua Parsing/Execution
48
49DIAGNOSTIC(400001, Fatal, scriptLoadError, "failure while loading lua script: $0")
50
51DIAGNOSTIC(400002, Fatal, scriptExecutionError, "failure while executing lua script: $0")
52
53
54// Scraper: Parsing
55
56DIAGNOSTIC(500001, Error, unexpected, "unexpected $0, expected $1")
57
58DIAGNOSTIC(
59    501001,
60    Error,
61    expectedFiddleEllipsisInvocation,
62    "expected 'FIDDLE(...)' at start of body of '$0'")
63
64DIAGNOSTIC(
65    502001,
66    Error,
67    expectedIncludeOfOutputHeader,
68    "expected a '#include' of generated output file '$0' in file containing 'FIDDLE(...)' "
69    "invocations")
70
71// Scraper: Semantic Checking
72
73DIAGNOSTIC(600001, Error, undefinedIdentifier, "undefined identifier '$0'")
74
75
76DIAGNOSTIC(999999, Fatal, internalError, "internal error in 'fiddle' tool")
77
78#undef DIAGNOSTIC