From 021a4923f429278b1d7434e01cbf83edcdf43da4 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 12 Apr 2018 17:08:52 -0700 Subject: Preprocessor cleanups (#484) * For a `#error` or `#warning`, read the rest of the line as raw text to include in the error message * When skipping tokens (e.g., in an `#ifdef`d out block), don't emit errors on invalid characters * TODO: we could clearly get more efficient and skip whole raw lines in the future * Fix an issue when a macro invocation that expands to nothing (zero tokens) is the last thing before a directive. The preprocessor was returning the `#` as an ordinary token, because it has already gone past its test for directives. --- source/slang/token-defs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/slang/token-defs.h') diff --git a/source/slang/token-defs.h b/source/slang/token-defs.h index 9edc1450d..a08084d85 100644 --- a/source/slang/token-defs.h +++ b/source/slang/token-defs.h @@ -29,6 +29,7 @@ TOKEN(WhiteSpace, "whitespace") TOKEN(NewLine, "newline") TOKEN(LineComment, "line comment") TOKEN(BlockComment, "block comment") +TOKEN(DirectiveMessage, "user-defined message") #define PUNCTUATION(id, text) \ TOKEN(id, "'" text "'") -- cgit v1.2.3