https://github.com/shader-slang/slang
Raw File
Tip revision: 6ab0baf910dea838dca2d29557c3361297180a34 authored by jsmall-nvidia on 22 August 2022, 21:39:56 UTC
Improve binary compatibility for DownstreamCompiler types (#2371)
Tip revision: 6ab0baf
slang-lexer-diagnostic-defs.h
// The file is meant to be included multiple times, to produce different
// pieces of declaration/definition code related to diagnostic messages
//
// Each diagnostic is declared here with:
//
//     DIAGNOSTIC(id, severity, name, messageFormat)
//
// Where `id` is the unique diagnostic ID, `severity` is the default
// severity (from the `Severity` enum), `name` is a name used to refer
// to this diagnostic from code, and `messageFormat` is the default
// (non-localized) message for the diagnostic, with placeholders
// for any arguments.

#ifndef DIAGNOSTIC
#error Need to #define DIAGNOSTIC(...) before including 
#define DIAGNOSTIC(id, severity, name, messageFormat) /* */
#endif

//
// 1xxxx - Lexical analysis
//

DIAGNOSTIC(10000, Error, illegalCharacterPrint, "illegal character '$0'")
DIAGNOSTIC(10000, Error, illegalCharacterHex, "illegal character (0x$0)")
DIAGNOSTIC(10001, Error, illegalCharacterLiteral, "illegal character literal")

DIAGNOSTIC(10002, Warning, octalLiteral, "'0' prefix indicates octal literal")
DIAGNOSTIC(10003, Error, invalidDigitForBase, "invalid digit for base-$1 literal: '$0'")

DIAGNOSTIC(10004, Error, endOfFileInLiteral, "end of file in literal")
DIAGNOSTIC(10005, Error, newlineInLiteral, "newline in literal")

#undef DIAGNOSTIC
back to top