From 9336a96638ee5076d32b32561bd3b3d66f2995c3 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Fri, 22 Mar 2024 13:39:57 +0800 Subject: [PATCH] Add support for RC (Windows Resource-definition Script) (#443) https://learn.microsoft.com/en-us/windows/win32/menurc/about-resource-files --- LANGUAGES.md | 1 + examples/language/version.rc | 51 ++++++++++++++++++++++++++++++++++++ languages.json | 34 ++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 examples/language/version.rc diff --git a/LANGUAGES.md b/LANGUAGES.md index 3d15d1940..fd711c86f 100644 --- a/LANGUAGES.md +++ b/LANGUAGES.md @@ -275,6 +275,7 @@ Visual Basic (vb) Visual Basic for Applications (cls) Vue (vue) Web Services Description Language (wsdl) +Windows Resource-Definition Script (rc) Wolfram (nb,wl) Wren (wren) XAML (xaml) diff --git a/examples/language/version.rc b/examples/language/version.rc new file mode 100644 index 000000000..a1f73d8ba --- /dev/null +++ b/examples/language/version.rc @@ -0,0 +1,51 @@ +#define VER_FILEVERSION 3,10,349,0 +#define VER_FILEVERSION_STR "3.10.349.0\0" + +#define VER_PRODUCTVERSION 3,10,0,0 +#define VER_PRODUCTVERSION_STR "3.10\0" + +#ifndef DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG VS_FF_DEBUG +#endif + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_PRODUCTVERSION +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG) +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "InternalName", VER_INTERNALNAME_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR + VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR + VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_PRODUCTVERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + /* The following line should only be modified for localized versions. */ + /* It consists of any number of WORD,WORD pairs, with each pair */ + /* describing a language,codepage combination supported by the file. */ + /* */ + /* For example, a file might have values "0x409,1252" indicating that it */ + /* supports English language (0x409) in the Windows ANSI codepage (1252). */ + + VALUE "Translation", 0x409, 1252 + + END +END diff --git a/languages.json b/languages.json index 54c18d1c1..7fab0af76 100644 --- a/languages.json +++ b/languages.json @@ -6372,6 +6372,40 @@ } ] }, + "Windows Resource-Definition Script": { + "extensions": [ + "rc" + ], + "line_comment": [ + "//" + ], + "multi_line": [ + [ + "/*", + "*/" + ] + ], + "quotes": [ + { + "end": "\"", + "start": "\"" + } + ], + "keywords": [ + "#include", + "#define", + "RC_INVOKED", + "VERSIONINFO", + "FILEVERSION", + "PRODUCTVERSION", + "FILEOS", + "FILETYPE", + "BLOCK", + "VALUE", + "StringFileInfo", + "VarFileInfo" + ] + }, "Robot Framework": { "complexitychecks": [], "extensions": [