From 4c66c17b2e5572c95da260ea4761f5804eb52853 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 3 Feb 2021 16:31:58 -0500 Subject: Diagnostic comparison using parsing (#1683) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP diagnostics for line number output. * Small param naming change * Use x macro for pass through compile human name lookup/getting. * WIP on parsing downstream compiler output. * Split out parsing into ParseDiagnosticUtil. Added test result of single line. * Dump out the std output on fail to parse diagnostics. * Change test type for syntax-error-intrinsic.slang be TEST not TEST_DIAGNOSTIC * Use Index for StringUtil. * WIP: First pass support for parsing Slang diagnostics. * WIP Testing comparing with ParseDiagnosticUtil with previous ad-hoc mechanism. * Use the new parsing mechanism for diagnostic comparisons. * Improvements to diagnostics parsing. Better error handling, and fallback handling. Added ability to parse downstream compilers without a prefix. Added ability to parse Slang with a prefix. --- source/core/slang-string-util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/core/slang-string-util.h') diff --git a/source/core/slang-string-util.h b/source/core/slang-string-util.h index dee4c7d66..dade8a61d 100644 --- a/source/core/slang-string-util.h +++ b/source/core/slang-string-util.h @@ -39,11 +39,11 @@ struct StringUtil /// Equivalent to doing a split and then finding the index of 'find' on the array /// Returns -1 if not found - static int indexOfInSplit(const UnownedStringSlice& in, char splitChar, const UnownedStringSlice& find); + static Index indexOfInSplit(const UnownedStringSlice& in, char splitChar, const UnownedStringSlice& find); /// Given the entry at the split index specified. /// Will return slice with begin() == nullptr if not found or input has begin() == nullptr) - static UnownedStringSlice getAtInSplit(const UnownedStringSlice& in, char splitChar, int index); + static UnownedStringSlice getAtInSplit(const UnownedStringSlice& in, char splitChar, Index index); /// Returns the size in bytes needed to hold the formatted string using the specified args, NOT including a terminating 0 /// NOTE! The caller *should* assume this will consume the va_list (use va_copy to make a copy to be consumed) -- cgit v1.2.3