summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/eval/decode.c
AgeCommit message (Collapse)AuthorFiles
2025-10-26vim-patch:8.1.1939: code for handling v: variables in generic eval file (#36312)Jan Edmund Lazo1
Problem: Code for handling v: variables in generic eval file. Solution: Move v: variables to evalvars.c. (Yegappan Lakshmanan, closes vim/vim#4872) https://github.com/vim/vim/commit/e5cdf153bcb348c68011b308c8988cea42d6ddeb Cherry-pick get_vim_var_name() from 8.2.0149. Cherry-pick evalvars.c changes from 8.2.1788. Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2024-12-23refactor: iwyu #31637Justin M. Keyes1
Result of `make iwyu` (after some "fixups").
2024-08-05build(deps): remove msgpack-c dependencybfredl1
2024-08-05refactor(shada): rework msgpack decoding without msgpack-cbfredl1
This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
2024-06-27refactor(typval)!: remove distinction of binary and nonbinary stringsbfredl1
This is a breaking change which will make refactor of typval and shada code a lot easier. In particular, code that would use or check for v:msgpack_types.binary in the wild would be broken. This appears to be rarely used in existing plugins. Also some cases where v:msgpack_type.string would be used to represent a binary string of "string" type, we use a BLOB instead, which is vimscripts native type for binary blobs, and already was used for BIN formats when necessary. msgpackdump(msgpackparse(data)) no longer preserves the distinction of BIN and STR strings. This is very common behavior for language-specific msgpack bindings. Nvim uses msgpack as a tool to serialize its data. Nvim is not a tool to bit-perfectly manipulate arbitrary msgpack data out in the wild. The changed tests should indicate how behavior changes in various edge cases.
2024-01-11refactor(IWYU): fix headersdundargoc1
Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
2023-12-06fix(json): allow objects with empty keys #25564Emanuel1
Problem: Empty string is a valid JSON key, but json_decode() treats an object with empty key as ":help msgpack-special-dict". #20757 :echo json_decode('{"": "1"}') {'_TYPE': [], '_VAL': [['', '1']]} Note: vim returns `{'': '1'}`. Solution: Allow empty string as an object key. Note that we still (currently) disallow empty keys in object_to_vim() (since 7c01d5ff9286d262097484c680e3a4eab49e2911): https://github.com/neovim/neovim/blob/f64e4b43e1191ff30d902730f752875aa55682ce/src/nvim/api/private/converter.c#L333-L334 Fix #20757 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-11-30build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq1
FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-11-27refactor: rename types.h to types_defs.hdundargoc1
2023-11-27build(IWYU): fix includes for func_attr.hdundargoc1
2023-11-12build: remove PVSdundargoc1
We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
2023-09-30build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq1
2023-06-22fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes1
followup to #24109 fix #16150
2023-04-07refactor: remove redundant const char * castsii141
2023-03-05vim-patch:9.0.1380: CTRL-X on 2**64 subtracts two (#22530)zeertzjq1
Problem: CTRL-X on 2**64 subtracts two. (James McCoy) Solution: Correct computation for large number. (closes vim/vim#12103) https://github.com/vim/vim/commit/5fb78c3fa5c996c08a65431d698bd2c251eef5c7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03refactor(build): graduate msgpack-c FLOAT32 "feature" since foreverbfredl1
2022-11-15build: allow IWYU to fix includes for all .c filesdundargoc1
Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
2022-11-06refactor: fix clang-tidy warningsdundargoc1
Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
2022-10-12refactor: clint (#20600)Lewis Russell1
2022-09-25refactor: move klib out of src/nvim/ #20341dundargoc1
It's confusing to mix vendored dependencies with neovim source code. A clean separation is simpler to keep track of and simpler to document.
2022-09-01refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-05-26refactor: missing parenthesis may cause unexpected problems (#17443)kylo2521
related vim-8.2.{4402,4639}
2022-05-09refactor: replace char_u variables and functions with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2022-05-07refactor: replace char_u variables and functions with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2022-05-05refactor: replace char_u variables and functions with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2021-12-06refactor: fix indent in decode.c (#16543)zeertzjq1
2021-12-05lint (#16526)Jan Edmund Lazo1
2021-11-01vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy1
Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
2021-09-18refactor: format #15702dundargoc1
2021-09-15feat(decode_string): decode binary string with NULs to BlobSean Dewar1
Strings that previously decoded into a msgpack special for representing BINs with NULs now convert to Blobs. It shouldn't be possible to decode into this special anymore after this change? Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
2021-09-11vim-patch:8.1.1355: obvious mistakes are accepted as valid expressionsSean Dewar1
Problem: Obvious mistakes are accepted as valid expressions. Solution: Be more strict about parsing numbers. (Yasuhiro Matsumoto, closes vim/vim#3981) https://github.com/vim/vim/commit/16e9b85113e0b354ece1cb4f5fcc7866850f3685 Update vim_str2nr_spec.lua to add more tests that use strict = true.
2021-01-31Use abort() instead of assert(false) for things that should never happenJames McCoy1
assert() is compiled out for release builds, but we don't want to continue running in these impossible situations. This also resolves the "implicit fallthrough" warnings for the asserts in switch cases.
2020-09-04robustness: avoid adding offset to NULL pointerBjörn Linse1
UBSAN with clang 10.0 is checking for adding offsets to a `NULL` pointer which is not allowed. This is not yet checked in the version of clang used in CI (7.0.0). I will work on cases of this so that tests passes locally for me. This could be tested in CI by either upgrading the clang of the ASAN/UBSAN to 10.0, or add yet another CI target which builds with clang 10.0.
2020-06-06vim-patch:8.2.0111: VAR_SPECIAL is also used for booleansBilly Su1
Problem: VAR_SPECIAL is also used for booleans. Solution: Add VAR_BOOL for better type checking. https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a
2019-02-04build: -Wmissing-prototypesJustin M. Keyes1
ref #343 Though I don't see a strong benefit, it isn't too much of a burden, and maybe avoids confusion in some cases.
2018-04-09eval/decode: Silence PVS/V547: code written for 32-bit integersZyX1
2018-01-15Merge #7806 from ZyX-I/list-statJustin M. Keyes1
Add a way to collect list usage statistics
2018-01-14*: Provide list length when allocating listsZyX1
2018-01-11coverity/169163: decode_string: Null pointer derefJustin M. Keyes1
*** CID 169163: Null pointer dereferences (FORWARD_NULL) /src/nvim/eval/decode.c: 290 in decode_string() 284 if (elw_ret == -1) { 285 tv_clear(&tv); 286 return (typval_T) { .v_type = VAR_UNKNOWN, .v_lock = VAR_UNLOCKED }; 287 } 288 return tv; 289 } else { >>> CID 169163: Null pointer dereferences (FORWARD_NULL) >>> Passing null pointer "s" to "xmemdupz", which dereferences it. (The dereference is assumed on the basis of the 'nonnull' parameter attribute.) 290 return (typval_T) { 291 .v_type = VAR_STRING, 292 .v_lock = VAR_UNLOCKED, 293 .vval = { .v_string = (char_u *)( 294 s_allocated ? (char *)s : xmemdupz(s, len)) }, 295 };
2017-12-24*: Remove most calls to tv_list_item_allocZyX1
Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the only reason why function did not receive `static` modifier.
2017-12-11*: Fix linter errorsZyX1
2017-12-10*: Hide list implementation in other files as wellZyX1
2017-12-10*: Start hiding list implementationZyX1
Most of files, except for eval.c and eval/* were only processed by perl.
2017-11-06eval/decode.c: Avoid NULL arg to memchr() #7332Adrian Neumann1
Clang complains because memchr has undefined behavior if the ptr is NULL, even if len==0. Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
2017-06-04lintJames McCoy1
2017-06-04vim-patch:7.4.1976James McCoy1
Problem: Number variables are not 64 bits while they could be. Solution: Add the num64 feature. (Ken Takata) https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
2017-05-08Merge branch 'master' into luaviml'/luaZyX1
2017-04-19*: Add comment to all C filesZyX1