mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Change parser_token_types from wcstring to const wchar_t *
Reduces allocations and startup time
This commit is contained in:
parent
574851f092
commit
7ad6a90ea2
3 changed files with 3 additions and 3 deletions
|
@ -104,7 +104,7 @@ static void dump_node(indent_t node_indent, const parse_node_t &node, const wcst
|
|||
}
|
||||
fwprintf(stderr, L"{off %4d, len %4d, indent %2u, %ls} [%ls|%ls|%ls]\n",
|
||||
node.source_start, node.source_length, node_indent,
|
||||
parser_token_types[node.type].c_str(), prevc_str, source.substr(node.source_start,
|
||||
parser_token_types[node.type], prevc_str, source.substr(node.source_start,
|
||||
node.source_length).c_str(), nextc_str);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ enum parse_token_type_t
|
|||
LAST_PARSE_TOKEN_TYPE = parse_token_type_end
|
||||
} __packed;
|
||||
// Array of strings corresponding to the enums above instantiated in parse_tree.cpp.
|
||||
extern wcstring parser_token_types[];
|
||||
extern const wchar_t * const parser_token_types[];
|
||||
|
||||
/* These must be maintained in sorted order (except for none, which isn't a keyword). This enables us to do binary search. */
|
||||
enum parse_keyword_t
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
// This array provides strings for each symbol in enum parse_token_type_t in parse_constants.h.
|
||||
wcstring parser_token_types[] = {
|
||||
const wchar_t * const parser_token_types[] = {
|
||||
L"token_type_invalid",
|
||||
L"symbol_job_list",
|
||||
L"symbol_job",
|
||||
|
|
Loading…
Reference in a new issue