From e9dc60cbd0b9e98a1560ce4c9ac00e0c1d28c6c5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Wed, 2 Feb 2022 16:08:59 +0100 Subject: Add underscrore to camelcase renames to split consecutive digits --- README.md | 2 ++ vk.generator/Program.cs | 6 ++++++ vulkan/vulkan.csproj | 7 ++----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bd54c51..2a433c6 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,6 @@ Auto-generated low level [Vulkan](https://www.khronos.org/vulkan/) bindings for The [nuget package](https://www.nuget.org/packages/Vulkan) is available under the name **Vulkan**. +Compiling Options: +-p:`AutoSetSType`=`true` diff --git a/vk.generator/Program.cs b/vk.generator/Program.cs index 0a6da2f..ba2fbab 100644 --- a/vk.generator/Program.cs +++ b/vk.generator/Program.cs @@ -65,6 +65,8 @@ namespace vk.generator { continue; if ((i == tmp.Length - 1 && Generator.tags.Contains (s)) || (char.IsDigit (s[0]) && s.Substring (1) == "D")) result.Add (s); + else if (char.IsDigit(s[0]) && result.LastOrDefault() is string lastStr && char.IsDigit(lastStr.Last())) + result.Add ("_" + s[0] + s.Substring (1).ToLower ()); else result.Add (s[0] + s.Substring (1).ToLower ()); } @@ -2015,6 +2017,10 @@ namespace vk.generator { } continue; } + if (l.StartsWith ("* [[")) { + int tmp = l.IndexOf ("]]", 3); + l = $"* {l.Substring (tmp + 2).Trim()}"; + } if (l.StartsWith ("* ename:") || l.StartsWith ("* pname:")) { l = l.Substring (8); int nameEndIdx = l.IndexOf (' '); diff --git a/vulkan/vulkan.csproj b/vulkan/vulkan.csproj index b60d202..798bfc0 100644 --- a/vulkan/vulkan.csproj +++ b/vulkan/vulkan.csproj @@ -3,7 +3,7 @@ netstandard2.1 - 0.4.0 + 0.4.1 Vulkan $(AssemblyVersion)-beta @@ -19,10 +19,7 @@ vk.net-64.png false - * Docummentation extracted from Vulkan-Docs - * no usafe code. - * use Vector type where possible - * Proxy structures to handle arrays. + * VkFormat in camel case taking care of consecutive numbers with underscore addition. false true -- cgit v1.3.1-4-g156e