Fixes:
1. Allocate space for the NUL byte.
2. Do not exclude last line from range.
3. Remove code for sandbox: it is handled earlier.
4. Fix index in new_line_transformed when converting NULs to NLs.
5. Always allocate new_line_transformed, but save allocated value.
1. Use `char *` for strings.
2. Add `const` qualifiers.
3. Add attributes and documentation.
4. Handle skipping *inside*.
5. Handle non-heredoc argument also inside: deferring this to the caller is
pointless because all callers need the same thing. Though new ex_lua caller
may live without allocations in this case, allocating nevertheless produces
cleaner code.
6. Note that all callers call script_get with `eap` and `eap->arg`. Thus second
argument is useless in practice: it is one and the same always and can be
reached through the first argument.
Fixes problem introduced by “api: Allow kObjectTypeNil to be zero without
breaking compatibility”: apparently there are clients which use metadata and
there are which aren’t. For the first that commit would not be needed, for the
second that commit misses this critical piece.
Now it checks functions also after every semicolon and closing figure brace,
possibly preceded by whitespaces (tabs and spaces). This should make messing
with declarations in macros not needed.
Reasoning: luajit is not being compiled with sanitizers, lua is. Given that
linking with sanitized libraries requires sanitizers enabled, it is needed to
either compile libnvim-test with sanitizers or link it with lua compiled without
sanitizers. Most easy way to do the latter is just use luajit which is compiled
without sanitizers (as they do not work well with luajit).
Function declarations generator is able to handle properly only the *first*
function definition that is in macros, and only if it is the first entity in the
macros. So msgpack_rpc_from_* was already really a static function, additionally
its attributes were useless. This commit switches to explicit declarations and
makes generated functions static.