From aee6f08ce12a62e9104892702a658a8d3daee4df Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 17 Apr 2023 13:08:53 +0200 Subject: fix(runtime): do not allow breakcheck inside runtime path calculation problem: breakcheck might run arbitrary lua code, which might require modules and thus invoke runtime path calculation recursively. solution: Block the use of breakcheck when expanding glob patterns inside 'runtimepath' fixes #23012 --- src/nvim/regexp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index dcc58fa34c..95296a5f90 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -10,6 +10,7 @@ #define RE_STRING 2 ///< match in string instead of buffer text #define RE_STRICT 4 ///< don't allow [abc] without ] #define RE_AUTO 8 ///< automatic engine selection +#define RE_NOBREAK 16 ///< don't use breakcheck functions // values for reg_do_extmatch #define REX_SET 1 ///< to allow \z\(...\), -- cgit From 4d757bbfbb6c0e5280563779c4b4ee1ce9142cf0 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sat, 4 Nov 2023 12:25:50 +0100 Subject: refactor: combine regexp files regext_bt.c and regexp_nfa.c are inlined into regexp.c instead of included as a header. This makes developer tools like clang-tidy and clangd be able to understand the code better. --- src/nvim/regexp.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index 95296a5f90..5760b4a4fa 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -17,12 +17,8 @@ #define REX_USE 2 ///< to allow \z\1 et al. #define REX_ALL (REX_SET | REX_USE) -// regexp.c -// uncrustify:off #ifdef INCLUDE_GENERATED_DECLARATIONS # include "regexp.h.generated.h" -# include "regexp_bt.h.generated.h" #endif -// uncrustify:on #endif // NVIM_REGEXP_H -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/regexp.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index 5760b4a4fa..f025584460 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -1,5 +1,4 @@ -#ifndef NVIM_REGEXP_H -#define NVIM_REGEXP_H +#pragma once #include "nvim/buffer_defs.h" #include "nvim/regexp_defs.h" @@ -20,5 +19,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "regexp.h.generated.h" #endif - -#endif // NVIM_REGEXP_H -- cgit From 09541d514dd18bf86f673d3784d406236fcbdad8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 09:51:26 +0800 Subject: build(IWYU): replace public-to-public mappings with pragmas (#26237) --- src/nvim/regexp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index f025584460..1f0e59aa89 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -1,7 +1,7 @@ #pragma once -#include "nvim/buffer_defs.h" -#include "nvim/regexp_defs.h" +#include "nvim/buffer_defs.h" // IWYU pragma: keep +#include "nvim/regexp_defs.h" // IWYU pragma: export #include "nvim/types.h" // Second argument for vim_regcomp(). -- cgit From 574d25642fc9ca65b396633aeab6e2d32778b642 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 17:21:58 +0800 Subject: refactor: move Arena and ArenaMem to memory_defs.h (#26240) --- src/nvim/regexp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index 1f0e59aa89..3a490aec55 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -1,6 +1,7 @@ #pragma once #include "nvim/buffer_defs.h" // IWYU pragma: keep +#include "nvim/pos.h" #include "nvim/regexp_defs.h" // IWYU pragma: export #include "nvim/types.h" -- cgit From f4aedbae4cb1f206f5b7c6142697b71dd473059b Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 18:39:38 +0100 Subject: build(IWYU): fix includes for undo_defs.h --- src/nvim/regexp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index 3a490aec55..426ac97493 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -1,7 +1,7 @@ #pragma once #include "nvim/buffer_defs.h" // IWYU pragma: keep -#include "nvim/pos.h" +#include "nvim/pos_defs.h" #include "nvim/regexp_defs.h" // IWYU pragma: export #include "nvim/types.h" -- cgit From 6c14ae6bfaf51415b555e9a6b85d1d280976358d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:27:32 +0100 Subject: refactor: rename types.h to types_defs.h --- src/nvim/regexp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index 426ac97493..b618f01e59 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -3,7 +3,7 @@ #include "nvim/buffer_defs.h" // IWYU pragma: keep #include "nvim/pos_defs.h" #include "nvim/regexp_defs.h" // IWYU pragma: export -#include "nvim/types.h" +#include "nvim/types_defs.h" // Second argument for vim_regcomp(). #define RE_MAGIC 1 ///< 'magic' option -- cgit From 718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 28 Nov 2023 07:47:36 +0800 Subject: refactor: fix runtime_defs.h (#26259) --- src/nvim/regexp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/regexp.h') diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index b618f01e59..447f4860a9 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -1,9 +1,9 @@ #pragma once #include "nvim/buffer_defs.h" // IWYU pragma: keep -#include "nvim/pos_defs.h" +#include "nvim/pos_defs.h" // IWYU pragma: keep #include "nvim/regexp_defs.h" // IWYU pragma: export -#include "nvim/types_defs.h" +#include "nvim/types_defs.h" // IWYU pragma: keep // Second argument for vim_regcomp(). #define RE_MAGIC 1 ///< 'magic' option -- cgit