From faf042ecc3e688a1a3ffbe1ac44d18dd7ddf441a Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 29 May 2025 08:05:57 -0700 Subject: 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> --- source/core/slang-type-text-util.cpp | 19 +++++++++++-------- source/core/slang-type-text-util.h | 8 ++++---- 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'source/core') 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 TypeTextUtil::getStdRevisionInfos() +/* static */ ConstArrayView TypeTextUtil::getLanguageVersionInfos() { - return makeConstArrayView(s_stdRevisionInfos); + return makeConstArrayView(s_languageVersionInfos); } /* static */ ConstArrayView 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 getLanguageInfos(); - /// Get the std revision infos - static ConstArrayView getStdRevisionInfos(); + /// Get the language version infos + static ConstArrayView getLanguageVersionInfos(); /// Get the compiler infos static ConstArrayView 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); -- cgit v1.2.3