mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-22 12:58:47 +08:00
Migrate token_infos inside token_for_string and reformat
This commit is contained in:
parent
e1c0ab8edb
commit
cf01694def
|
@ -116,8 +116,9 @@ struct token_info_t {
|
|||
unsigned int flags;
|
||||
};
|
||||
|
||||
static const std::map<wcstring, const token_info_t> token_infos =
|
||||
{{L"", {test_unknown, 0}},
|
||||
const token_info_t * const token_for_string(const wcstring &str) {
|
||||
static const std::map<wcstring, const token_info_t> token_infos = {
|
||||
{L"", {test_unknown, 0}},
|
||||
{L"!", {test_bang, 0}},
|
||||
{L"-b", {test_filetype_b, UNARY_PRIMARY}},
|
||||
{L"-c", {test_filetype_c, UNARY_PRIMARY}},
|
||||
|
@ -153,7 +154,6 @@ struct token_info_t {
|
|||
{L"(", {test_paren_open, 0}},
|
||||
{L")", {test_paren_close, 0}}};
|
||||
|
||||
const token_info_t * const token_for_string(const wcstring &str) {
|
||||
auto t = token_infos.find(str);
|
||||
if (t != token_infos.end()) return &t->second;
|
||||
return &token_infos.find(L"")->second;
|
||||
|
|
Loading…
Reference in New Issue
Block a user