From 55ab2f6e6d8030f9f3fd94523a2da1e8a78b39c0 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Fri, 1 Oct 2021 04:49:46 -0700 Subject: [PATCH] Remove some unsued macros and a template --- src/ast.cpp | 7 ------- src/builtin_set.cpp | 2 -- src/highlight.cpp | 2 -- src/parse_constants.h | 1 - src/parser.cpp | 3 --- 5 files changed, 15 deletions(-) diff --git a/src/ast.cpp b/src/ast.cpp index c50c8fe41..14e9e03df 100644 --- a/src/ast.cpp +++ b/src/ast.cpp @@ -1080,13 +1080,6 @@ struct populator_t { node.accept(*this); } - template - void visit_pointer_field(Node *&node) { - // This field is a pointer embedding of an ast node. - // Allocate and populate it. - node = allocate_visit(); - } - // Overload for token fields. template void visit_node_field(token_t &token) { diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index 3067ae321..0fee757f5 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -71,8 +71,6 @@ static const struct woption long_options[] = { {L"help", no_argument, nullptr, 'h'}, {nullptr, 0, nullptr, 0}}; // Hint for invalid path operation with a colon. -#define BUILTIN_SET_PATH_ERROR _(L"%ls: Warning: $%ls entry \"%ls\" is not valid (%s)\n") -#define BUILTIN_SET_PATH_HINT _(L"%ls: Did you mean 'set %ls $%ls %ls'?\n") #define BUILTIN_SET_MISMATCHED_ARGS _(L"%ls: You provided %d indexes but %d values\n") #define BUILTIN_SET_ERASE_NO_VAR _(L"%ls: Erase needs a variable name\n") #define BUILTIN_SET_ARRAY_BOUNDS_ERR _(L"%ls: Array index out of bounds\n") diff --git a/src/highlight.cpp b/src/highlight.cpp index cbbab5b4b..69948d16b 100644 --- a/src/highlight.cpp +++ b/src/highlight.cpp @@ -37,8 +37,6 @@ #include "wildcard.h" #include "wutil.h" // IWYU pragma: keep -#define CURSOR_POSITION_INVALID static_cast(-1) - static const wchar_t *get_highlight_var_name(highlight_role_t role) { switch (role) { case highlight_role_t::normal: diff --git a/src/parse_constants.h b/src/parse_constants.h index fcc04d05c..76451f292 100644 --- a/src/parse_constants.h +++ b/src/parse_constants.h @@ -58,7 +58,6 @@ const enum_map token_enum_map[] = { {parse_token_type_t::terminate, L"parse_token_type_t::terminate"}, {parse_token_type_t::invalid, L"parse_token_type_t::invalid"}, {parse_token_type_t::invalid, nullptr}}; -#define token_enum_map_len (sizeof token_enum_map / sizeof *token_enum_map) // IMPORTANT: If the following enum is modified you must update the corresponding keyword_enum_map // array below. diff --git a/src/parser.cpp b/src/parser.cpp index 078046cac..83c7238a1 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -32,9 +32,6 @@ class io_chain_t; -/// Error for evaluating in illegal scope. -#define INVALID_SCOPE_ERR_MSG _(L"Tried to evaluate commands using invalid block type '%ls'") - /// While block description. #define WHILE_BLOCK N_(L"'while' block")