diff options
author | ZyX <kp-pav@yandex.ru> | 2017-11-06 20:28:37 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-11-06 20:28:37 +0300 |
commit | 4aebd00a9eeeb2f56ff53dd4e383825e997ee7be (patch) | |
tree | 21fdcc712a9a7eaf0800088e644b372d402bf3d5 | |
parent | 24a353364d6d186d528009fd0bb603d87183cf35 (diff) | |
download | rneovim-4aebd00a9eeeb2f56ff53dd4e383825e997ee7be.tar.gz rneovim-4aebd00a9eeeb2f56ff53dd4e383825e997ee7be.tar.bz2 rneovim-4aebd00a9eeeb2f56ff53dd4e383825e997ee7be.zip |
*: Fix linter errors
-rw-r--r-- | src/nvim/api/vim.c | 20 | ||||
-rw-r--r-- | src/nvim/viml/parser/expressions.c | 2 | ||||
-rw-r--r-- | test/helpers.lua | 6 | ||||
-rw-r--r-- | test/unit/charset/vim_str2nr_spec.lua | 1 | ||||
-rw-r--r-- | test/unit/viml/helpers.lua | 1 |
5 files changed, 14 insertions, 16 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 0596c3ebd8..bac19ef363 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -930,7 +930,7 @@ typedef kvec_withinit_t(ExprASTConvStackItem, 16) ExprASTConvStack; /// @note: “Sucessfully parsed” here means “participated in AST /// creation”, not “till the first error”. /// -/// "ast": actual AST, either nil or a dictionary with the following +/// "ast": actual AST, either nil or a dictionary with the following /// keys: /// /// "type": node type, one of the value names from ExprASTNodeType @@ -1009,10 +1009,10 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight, ExprAST east = viml_pexpr_parse(&pstate, pflags); const size_t ret_size = ( - 2 // "ast", "len" - + (size_t)(east.err.msg != NULL) // "error" - + (size_t)highlight // "highlight" - ); + 2 // "ast", "len" + + (size_t)(east.err.msg != NULL) // "error" + + (size_t)highlight // "highlight" + + 0); Dictionary ret = { .items = xmalloc(ret_size * sizeof(ret.items[0])), .size = 0, @@ -1242,12 +1242,12 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight, ret_node->items[ret_node->size++] = (KeyValuePair) { .key = STATIC_CSTR_TO_STRING("cmp_type"), .value = STRING_OBJ(cstr_to_string( - eltkn_cmp_type_tab[node->data.cmp.type])), + eltkn_cmp_type_tab[node->data.cmp.type])), }; ret_node->items[ret_node->size++] = (KeyValuePair) { .key = STATIC_CSTR_TO_STRING("ccs_strategy"), .value = STRING_OBJ(cstr_to_string( - ccs_tab[node->data.cmp.ccs])), + ccs_tab[node->data.cmp.ccs])), }; ret_node->items[ret_node->size++] = (KeyValuePair) { .key = STATIC_CSTR_TO_STRING("invert"), @@ -1266,9 +1266,9 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight, ret_node->items[ret_node->size++] = (KeyValuePair) { .key = STATIC_CSTR_TO_STRING("ivalue"), .value = INTEGER_OBJ((Integer)( - node->data.num.value > API_INTEGER_MAX - ? API_INTEGER_MAX - : (Integer)node->data.num.value)), + node->data.num.value > API_INTEGER_MAX + ? API_INTEGER_MAX + : (Integer)node->data.num.value)), }; break; } diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c index 998edb1ed4..71eda2cdc1 100644 --- a/src/nvim/viml/parser/expressions.c +++ b/src/nvim/viml/parser/expressions.c @@ -22,7 +22,7 @@ // ignored in Neovim it is an error. // 4. Expressions parser has generally better error reporting. But for // compatibility reasons most errors have error code E15 while error messages -// are significantly different from Vim’s E15. Also some error codes were +// are significantly different from Vim’s E15. Also some error codes were // retired because of being harder to emulate or because of them being // a result of differences in parsing process: e.g. with ":echo {a, b}" Vim // will attempt to parse expression as lambda, fail, check whether it is diff --git a/test/helpers.lua b/test/helpers.lua index 16b9818f12..d24fae745b 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -301,10 +301,10 @@ local function mergedicts_copy(d1, d2) for k, v in pairs(d2) do if d2[k] == REMOVE_THIS then ret[k] = nil - elseif type(d1[k]) == 'table' and type(d2[k]) == 'table' then - ret[k] = mergedicts_copy(d1[k], d2[k]) + elseif type(d1[k]) == 'table' and type(v) == 'table' then + ret[k] = mergedicts_copy(d1[k], v) else - ret[k] = d2[k] + ret[k] = v end end return ret diff --git a/test/unit/charset/vim_str2nr_spec.lua b/test/unit/charset/vim_str2nr_spec.lua index 9309dc380c..22504649f6 100644 --- a/test/unit/charset/vim_str2nr_spec.lua +++ b/test/unit/charset/vim_str2nr_spec.lua @@ -5,7 +5,6 @@ local itp = helpers.gen_itp(it) local cimport = helpers.cimport local ffi = helpers.ffi -local eq = helpers.eq local shallowcopy = global_helpers.shallowcopy local updated = global_helpers.updated diff --git a/test/unit/viml/helpers.lua b/test/unit/viml/helpers.lua index aeb886a66f..9d2d7b61c7 100644 --- a/test/unit/viml/helpers.lua +++ b/test/unit/viml/helpers.lua @@ -112,7 +112,6 @@ return { pline2lua = pline2lua, pstate_str = pstate_str, new_pstate = new_pstate, - intchar2lua = intchar2lua, conv_cmp_type = conv_cmp_type, pstate_set_str = pstate_set_str, } |