summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-05-29 08:05:57 -0700
committerGitHub <noreply@github.com>2025-05-29 08:05:57 -0700
commitfaf042ecc3e688a1a3ffbe1ac44d18dd7ddf441a (patch)
treeb54abb2e65b7791d74335ead396cf762f805ab5c /source/core
parent45d794f57d453a5564a7360400c5bfc04bf12b31 (diff)
Language version + tuple syntax. (#7230)
* Language version + tuple syntax. * Fix compile error. * regenerate documentation Table of Contents * Fix. * regenerate command line reference * Fix. * Fix. * Fix more test failures. * revert empty line change, * Retrigger CI * #version->#lang * Update source/core/slang-type-text-util.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> * Remove comments. * Fix parsing logic. * Fix parser. * Fix parser. * update test comment * Update options. * regenerate documentation Table of Contents * regenerate command line reference --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-type-text-util.cpp19
-rw-r--r--source/core/slang-type-text-util.h8
2 files changed, 15 insertions, 12 deletions
diff --git a/source/core/slang-type-text-util.cpp b/source/core/slang-type-text-util.cpp
index 4797395b7..9f55b69e2 100644
--- a/source/core/slang-type-text-util.cpp
+++ b/source/core/slang-type-text-util.cpp
@@ -99,10 +99,10 @@ static const NamesDescriptionValue s_languageInfos[] = {
{SLANG_SOURCE_LANGUAGE_CUDA, "cu,cuda", "CUDA"},
};
-static const NamesDescriptionValue s_stdRevisionInfos[] = {
- {SLANG_STD_REVISION_UNKNOWN, "unknown", "Unknown"},
- {SLANG_STD_REVISION_2025, "2025,default", "Slang language rules for 2025 and older"},
- {SLANG_STD_REVISION_2026, "2026", "Slang language rules for 2026 and newer"},
+static const NamesDescriptionValue s_languageVersionInfos[] = {
+ {SLANG_LANGUAGE_VERSION_LEGACY, "legacy,default,2018", "Legacy Slang language"},
+ {SLANG_LANGUAGE_VERSION_2025, "2025", "Slang language rules for 2025 and older"},
+ {SLANG_LANGUAGE_VERSION_2026, "2026,latest", "Slang language rules for 2026 and newer"},
};
static const NamesDescriptionValue s_compilerInfos[] = {
@@ -223,9 +223,9 @@ static const NamesDescriptionValue s_fileSystemTypes[] = {
return makeConstArrayView(s_languageInfos);
}
-/* static */ ConstArrayView<NamesDescriptionValue> TypeTextUtil::getStdRevisionInfos()
+/* static */ ConstArrayView<NamesDescriptionValue> TypeTextUtil::getLanguageVersionInfos()
{
- return makeConstArrayView(s_stdRevisionInfos);
+ return makeConstArrayView(s_languageVersionInfos);
}
/* static */ ConstArrayView<NamesDescriptionValue> TypeTextUtil::getCompilerInfos()
@@ -328,9 +328,12 @@ static const NamesDescriptionValue s_fileSystemTypes[] = {
return NameValueUtil::findValue(getLanguageInfos(), text, SLANG_SOURCE_LANGUAGE_UNKNOWN);
}
-/* static */ SlangStdRevision TypeTextUtil::findStdRevision(const UnownedStringSlice& text)
+/* static */ SlangLanguageVersion TypeTextUtil::findLanguageVersion(const UnownedStringSlice& text)
{
- return NameValueUtil::findValue(getStdRevisionInfos(), text, SLANG_STD_REVISION_UNKNOWN);
+ return NameValueUtil::findValue(
+ getLanguageVersionInfos(),
+ text,
+ SLANG_LANGUAGE_VERSION_UNKNOWN);
}
/* static */ SlangPassThrough TypeTextUtil::findPassThrough(const UnownedStringSlice& slice)
diff --git a/source/core/slang-type-text-util.h b/source/core/slang-type-text-util.h
index bc136c3ab..eddbcec5e 100644
--- a/source/core/slang-type-text-util.h
+++ b/source/core/slang-type-text-util.h
@@ -33,8 +33,8 @@ struct TypeTextUtil
/// Get the language infos
static ConstArrayView<NamesDescriptionValue> getLanguageInfos();
- /// Get the std revision infos
- static ConstArrayView<NamesDescriptionValue> getStdRevisionInfos();
+ /// Get the language version infos
+ static ConstArrayView<NamesDescriptionValue> getLanguageVersionInfos();
/// Get the compiler infos
static ConstArrayView<NamesDescriptionValue> getCompilerInfos();
/// Get the archive type infos
@@ -73,8 +73,8 @@ struct TypeTextUtil
/// Given a source language name returns a source language. Name here is distinct from extension
static SlangSourceLanguage findSourceLanguage(const UnownedStringSlice& text);
- /// Given a std revision returns a std revision.
- static SlangStdRevision findStdRevision(const UnownedStringSlice& text);
+ /// Given a language version name returns a language revision.
+ static SlangLanguageVersion findLanguageVersion(const UnownedStringSlice& text);
/// Given a name returns the pass through
static SlangPassThrough findPassThrough(const UnownedStringSlice& slice);