diff options
| author | Yong He <yonghe@outlook.com> | 2025-02-27 10:32:14 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-27 10:32:14 -0800 |
| commit | 6cf15f4ea1fe044d8227440dcc30ac712334568e (patch) | |
| tree | 668f3ef00fd0b144dd3221ee4ab8d344397649d8 /tools | |
| parent | 2ebf9555a54c00f45b1cd0bdd7f6c163120bb845 (diff) | |
Allow `.member` syntax on vector and scalars. (#6424)
* Allow `.member` syntax on vector and scalars.
* Fix.
* fix.
* Fix.
* update comment.
* Fix tests.
* Fix warning.
* Add more tests.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 10bc99017..57328c210 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -2037,9 +2037,13 @@ TestResult runLanguageServerTest(TestContext* context, TestInput& input) int callId = 2; for (auto line : lines) { - if (line.startsWith("//COMPLETE:")) + line = line.trimStart(); + if (!line.startsWith("//")) + continue; + line = line.tail(2).trimStart(); + if (line.startsWith("COMPLETE:")) { - auto arg = line.tail(UnownedStringSlice("//COMPLETE:").getLength()); + auto arg = line.tail(UnownedStringSlice("COMPLETE:").getLength()); Int linePos, colPos; parseLocation(arg, 0, linePos, colPos); @@ -2074,9 +2078,9 @@ TestResult runLanguageServerTest(TestContext* context, TestInput& input) } } } - else if (line.startsWith("//SIGNATURE:")) + else if (line.startsWith("SIGNATURE:")) { - auto arg = line.tail(UnownedStringSlice("//SIGNATURE:").getLength()); + auto arg = line.tail(UnownedStringSlice("SIGNATURE:").getLength()); Int linePos, colPos; parseLocation(arg, 0, linePos, colPos); @@ -2116,9 +2120,9 @@ TestResult runLanguageServerTest(TestContext* context, TestInput& input) } } } - else if (line.startsWith("//HOVER:")) + else if (line.startsWith("HOVER:")) { - auto arg = line.tail(UnownedStringSlice("//HOVER:").getLength()); + auto arg = line.tail(UnownedStringSlice("HOVER:").getLength()); Int linePos, colPos; parseLocation(arg, 0, linePos, colPos); @@ -2150,7 +2154,7 @@ TestResult runLanguageServerTest(TestContext* context, TestInput& input) actualOutputSB << "\ncontent:\n" << hover.contents.value << "\n"; } } - else if (line.startsWith("//DIAGNOSTICS")) + else if (line.startsWith("DIAGNOSTICS")) { if (!diagnosticsReceived) { |
