diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-02-03 16:31:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-03 16:31:58 -0500 |
| commit | 4c66c17b2e5572c95da260ea4761f5804eb52853 (patch) | |
| tree | 198a2f7aeffb17d3a87fbe6223e1d8df32287562 /source/core/slang-string-util.cpp | |
| parent | a1d543d9b1bf3b2bcd813a498d2d3e24de67106d (diff) | |
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.
Diffstat (limited to 'source/core/slang-string-util.cpp')
| -rw-r--r-- | source/core/slang-string-util.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/core/slang-string-util.cpp b/source/core/slang-string-util.cpp index a859c6945..cac7c7cfa 100644 --- a/source/core/slang-string-util.cpp +++ b/source/core/slang-string-util.cpp @@ -136,12 +136,12 @@ namespace Slang { } } -/* static */int StringUtil::indexOfInSplit(const UnownedStringSlice& in, char splitChar, const UnownedStringSlice& find) +/* static */Index StringUtil::indexOfInSplit(const UnownedStringSlice& in, char splitChar, const UnownedStringSlice& find) { const char* start = in.begin(); const char* end = in.end(); - for (int i = 0; start < end; ++i) + for (Index i = 0; start < end; ++i) { // Move cur so it's either at the end or at next split character const char* cur = start; @@ -162,12 +162,12 @@ namespace Slang { return -1; } -UnownedStringSlice StringUtil::getAtInSplit(const UnownedStringSlice& in, char splitChar, int index) +UnownedStringSlice StringUtil::getAtInSplit(const UnownedStringSlice& in, char splitChar, Index index) { const char* start = in.begin(); const char* end = in.end(); - for (int i = 0; start < end; ++i) + for (Index i = 0; start < end; ++i) { // Move cur so it's either at the end or at next split character const char* cur = start; |
