From 0f1bf2b213e7c5846e83f76365ce4480a1fe4dbb Mon Sep 17 00:00:00 2001 From: Alan de Freitas Date: Tue, 22 Jul 2025 14:33:29 -0500 Subject: [PATCH 1/4] ci: add .run to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 541ba3f198..6e5f29e69b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /.idea /.vs /.vscode +/.run /CMakeUserPresets.json /CMakeSettings.json /build From 86f9efa33f7e2812bbd85aa2b1f04e08b2599bd9 Mon Sep 17 00:00:00 2001 From: Alan de Freitas Date: Tue, 22 Jul 2025 14:33:51 -0500 Subject: [PATCH 2/4] build: remove fmt from bootstrap.py --- CMakeLists.txt | 6 ------ bootstrap.py | 36 ++++-------------------------------- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14219e4304..89441f78f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,6 @@ #------------------------------------------------- cmake_minimum_required(VERSION 3.13) -if (GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configurations" FORCE) -elseif(NOT GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE) -endif() project( MrDocs VERSION 0.0.3 @@ -256,7 +251,6 @@ if (WIN32) -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX20_CISO646_REMOVED_WARNING - -DFMT_HEADER_ONLY # because of _ITERATOR_DEBUG_LEVEL ) if(MSVC) get_target_property(LLVM_CONFIGURATION_TYPE LLVMCore IMPORTED_CONFIGURATIONS) diff --git a/bootstrap.py b/bootstrap.py index 5f67d23708..621c4d1d9d 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -65,14 +65,6 @@ class InstallOptions: # Third-party dependencies third_party_src_dir: str = "/../third-party" - # Fmt - fmt_src_dir: str = "/fmt" - fmt_build_type: str = "" - fmt_build_dir: str = "/build/" - fmt_install_dir: str = "/install/" - fmt_repo: str = "https://github.com/fmtlib/fmt" - fmt_branch: str = "10.2.1" - # Duktape duktape_src_dir: str = "/duktape" duktape_url: str = "https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz" @@ -116,12 +108,6 @@ class InstallOptions: "mrdocs_system_install": "Whether to install MrDocs to the system directories instead of a custom install directory.", "mrdocs_run_tests": "Whether to run tests after building MrDocs.", "third_party_src_dir": "Directory for all third-party source dependencies.", - "fmt_src_dir": "Directory for the fmt library source code.", - "fmt_build_type": "CMake build type for the fmt library. (Release, Debug, RelWithDebInfo, MilRelSize, DebWithOpt)", - "fmt_build_dir": "Directory where the fmt library will be built.", - "fmt_install_dir": "Directory where the fmt library will be installed.", - "fmt_repo": "URL of the fmt library repository to clone.", - "fmt_branch": "Branch or tag of the fmt library to use.", "duktape_src_dir": "Directory for the Duktape source code.", "duktape_url": "Download URL for the Duktape source archive.", "duktape_build_type": "CMake build type for Duktape. (Release, Debug, RelWithDebInfo, MilRelSize, DebWithOpt)", @@ -259,7 +245,7 @@ def repl(match): key = match.group(1) has_dir_key = has_dir_key or key.endswith("-dir") key = key.replace("-", "_") - fmt = match.group(2) + transform_fn = match.group(2) if key == 'os': if self.is_windows(): val = "windows" @@ -271,10 +257,10 @@ def repl(match): raise ValueError("Unsupported operating system.") else: val = getattr(self.options, key, None) - if fmt: - if fmt == "lower": + if transform_fn: + if transform_fn == "lower": val = val.lower() - elif fmt == "upper": + elif transform_fn == "upper": val = val.upper() # Add more formats as needed return val @@ -539,17 +525,6 @@ def setup_third_party_dir(self): self.prompt_dependency_path_option("third_party_src_dir") os.makedirs(self.options.third_party_src_dir, exist_ok=True) - def install_fmt(self): - self.prompt_dependency_path_option("fmt_src_dir") - if not os.path.exists(self.options.fmt_src_dir): - self.prompt_option("fmt_repo") - self.prompt_option("fmt_branch") - self.clone_repo(self.options.fmt_repo, self.options.fmt_src_dir, branch=self.options.fmt_branch, depth=1) - self.prompt_build_type_option("fmt_build_type") - self.prompt_dependency_path_option("fmt_build_dir") - self.prompt_dependency_path_option("fmt_install_dir") - self.cmake_workflow(self.options.fmt_src_dir, self.options.fmt_build_type, self.options.fmt_build_dir, self.options.fmt_install_dir, ["-D", "FMT_DOC=OFF", "-D", "FMT_TEST=OFF"]) - def install_duktape(self): self.prompt_dependency_path_option("duktape_src_dir") if not os.path.exists(self.options.duktape_src_dir): @@ -715,7 +690,6 @@ def create_cmake_presets(self): "Clang_ROOT": self.options.llvm_install_dir, "duktape_ROOT": self.options.duktape_install_dir, "Duktape_ROOT": self.options.duktape_install_dir, - "fmt_ROOT": self.options.fmt_install_dir, "libxml2_ROOT": self.options.libxml2_install_dir, "LibXml2_ROOT": self.options.libxml2_install_dir, "MRDOCS_BUILD_TESTS": self.options.mrdocs_build_tests, @@ -797,7 +771,6 @@ def install_mrdocs(self): "-D", f"Clang_ROOT={self.options.llvm_install_dir}", "-D", f"duktape_ROOT={self.options.duktape_install_dir}", "-D", f"Duktape_ROOT={self.options.duktape_install_dir}", - "-D", f"fmt_ROOT={self.options.fmt_install_dir}" ]) if self.options.mrdocs_build_tests: extra_args.extend([ @@ -828,7 +801,6 @@ def install_all(self): self.check_tools() self.setup_mrdocs_dir() self.setup_third_party_dir() - self.install_fmt() self.install_duktape() if self.options.mrdocs_build_tests: self.install_libxml2() From c114bf32320182e568f2d56de93d8e343e3a6234 Mon Sep 17 00:00:00 2001 From: Alan de Freitas Date: Tue, 22 Jul 2025 14:34:50 -0500 Subject: [PATCH 3/4] fix: repopulating TArg doesn't push back --- src/lib/AST/ASTVisitor.hpp | 8 +++++++- .../record/class-template-specializations-3.adoc | 16 ++++++++-------- .../record/class-template-specializations-3.html | 16 ++++++++-------- .../record/class-template-specializations-3.xml | 2 -- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/lib/AST/ASTVisitor.hpp b/src/lib/AST/ASTVisitor.hpp index 5a0295ec1f..cd44a71eab 100644 --- a/src/lib/AST/ASTVisitor.hpp +++ b/src/lib/AST/ASTVisitor.hpp @@ -684,6 +684,7 @@ class ASTVisitor std::vector>& result, Range&& args) { + std::size_t i = 0; for (TemplateArgument const& arg : args) { if (arg.getIsDefaulted()) @@ -699,8 +700,13 @@ class ASTVisitor } else { - result.emplace_back(toTArg(arg)); + if (i + 1 > result.size()) + { + result.emplace_back(); + } + result[i] = toTArg(arg); } + ++i; } } diff --git a/test-files/golden-tests/symbols/record/class-template-specializations-3.adoc b/test-files/golden-tests/symbols/record/class-template-specializations-3.adoc index 8761833767..2f054ed99d 100644 --- a/test-files/golden-tests/symbols/record/class-template-specializations-3.adoc +++ b/test-files/golden-tests/symbols/record/class-template-specializations-3.adoc @@ -702,7 +702,7 @@ struct link:#A-0e[A]<float>; |=== | Name | link:#A-01-B-07[`B`] -| link:#A-01-B-08[`B<double, double>`] +| link:#A-01-B-08[`B<double>`] |=== [#A-01-B-07] @@ -719,7 +719,7 @@ struct B; ---- [#A-01-B-08] -== link:#A-01[A<float>]::link:#A-0e-B-07[B]<double, double> +== link:#A-01[A<float>]::link:#A-0e-B-07[B]<double> === Synopsis @@ -728,7 +728,7 @@ Declared in `<class‐template‐specializations‐3.cp [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> -struct link:#A-0e-B-07[B]<double, double>; +struct link:#A-0e-B-07[B]<double>; ---- === Types @@ -738,11 +738,11 @@ struct link:#A-0e-B-07[B]<double, double>; | Name | link:#A-01-B-08-C[`C`] | link:#A-01-B-08-D-0ae[`D`] -| link:#A-01-B-08-D-0af[`D<bool, bool>`] +| link:#A-01-B-08-D-0af[`D<bool>`] |=== [#A-01-B-08-C] -== link:#A-01[A<float>]::link:#A-01-B-08[B<double, double>]::C +== link:#A-01[A<float>]::link:#A-01-B-08[B<double>]::C === Synopsis @@ -754,7 +754,7 @@ struct C; ---- [#A-01-B-08-D-0ae] -== link:#A-01[A<float>]::link:#A-01-B-08[B<double, double>]::D +== link:#A-01[A<float>]::link:#A-01-B-08[B<double>]::D === Synopsis @@ -767,7 +767,7 @@ struct D; ---- [#A-01-B-08-D-0af] -== link:#A-01[A<float>]::link:#A-01-B-08[B<double, double>]::link:#A-0e-B-00-D-09[D]<bool, bool> +== link:#A-01[A<float>]::link:#A-01-B-08[B<double>]::link:#A-0e-B-00-D-09[D]<bool> === Synopsis @@ -776,7 +776,7 @@ Declared in `<class‐template‐specializations‐3.cp [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> -struct link:#A-0e-B-00-D-09[D]<bool, bool>; +struct link:#A-0e-B-00-D-09[D]<bool>; ---- [#E] diff --git a/test-files/golden-tests/symbols/record/class-template-specializations-3.html b/test-files/golden-tests/symbols/record/class-template-specializations-3.html index 061c34ae6b..e653195d31 100644 --- a/test-files/golden-tests/symbols/record/class-template-specializations-3.html +++ b/test-files/golden-tests/symbols/record/class-template-specializations-3.html @@ -994,7 +994,7 @@

Types

B -B<double, double> +B<double> @@ -1021,7 +1021,7 @@

Synopsis

Synopsis

@@ -1030,7 +1030,7 @@

Synopsis

 
 template<>
-struct B<double, double>;
+struct B<double>;
 
 
@@ -1045,7 +1045,7 @@

Types

C D -D<bool, bool> +D<bool> @@ -1054,7 +1054,7 @@

Types

Synopsis

@@ -1071,7 +1071,7 @@

Synopsis

Synopsis

@@ -1089,7 +1089,7 @@

Synopsis

Synopsis

@@ -1098,7 +1098,7 @@

Synopsis

 
 template<>
-struct D<bool, bool>;
+struct D<bool>;
 
 
diff --git a/test-files/golden-tests/symbols/record/class-template-specializations-3.xml b/test-files/golden-tests/symbols/record/class-template-specializations-3.xml index b4509e366d..8f1c81e529 100644 --- a/test-files/golden-tests/symbols/record/class-template-specializations-3.xml +++ b/test-files/golden-tests/symbols/record/class-template-specializations-3.xml @@ -239,7 +239,6 @@