yum-mirror/slang

Making it easier to work with shaders

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

Ellie Hermaszewskaformatf65d756bf

master
1.5 KiB40 linesraw
1// The file is meant to be included multiple times, to produce different
2// pieces of declaration/definition code related to diagnostic messages
3//
4// Each diagnostic is declared here with:
5//
6//     DIAGNOSTIC(id, severity, name, messageFormat)
7//
8// Where `id` is the unique diagnostic ID, `severity` is the default
9// severity (from the `Severity` enum), `name` is a name used to refer
10// to this diagnostic from code, and `messageFormat` is the default
11// (non-localized) message for the diagnostic, with placeholders
12// for any arguments.
13
14#ifndef DIAGNOSTIC
15#error Need to #define DIAGNOSTIC(...) before including
16#define DIAGNOSTIC(id, severity, name, messageFormat) /* */
17#endif
18
19//
20// 1xxxx - Lexical analysis
21//
22
23DIAGNOSTIC(10000, Error, illegalCharacterPrint, "illegal character '$0'")
24DIAGNOSTIC(10000, Error, illegalCharacterHex, "illegal character (0x$0)")
25DIAGNOSTIC(10001, Error, illegalCharacterLiteral, "illegal character literal")
26
27DIAGNOSTIC(10002, Warning, octalLiteral, "'0' prefix indicates octal literal")
28DIAGNOSTIC(10003, Error, invalidDigitForBase, "invalid digit for base-$1 literal: '$0'")
29
30DIAGNOSTIC(10004, Error, endOfFileInLiteral, "end of file in literal")
31DIAGNOSTIC(10005, Error, newlineInLiteral, "newline in literal")
32DIAGNOSTIC(
33    10010,
34    Error,
35    quoteCannotBeDelimiter,
36    "'\"' encountered before '(' in raw string literal. '\"' cannot be a part of a delimiter.")
37
38DIAGNOSTIC(10011, Error, unexpectedEndOfInput, "unexpected end of input")
39
40#undef DIAGNOSTIC