Bram Moolenaar
23018f2d4b
patch 8.2.3910: when compare function of sort() fails it does not abort
...
Problem: When the compare function of sort() produces and error then sort()
does not abort.
Solution: Check if did_emsg was incremented.
2021-12-27 11:54:37 +00:00
Bram Moolenaar
1802405d71
patch 8.2.3897: Vim9: second argument of map() and filter() not checked
...
Problem: Vim9: the second argument of map() and filter() is not checked at
compile time.
Solution: Add more specific type check for the second argument.
2021-12-25 21:43:28 +00:00
Yegappan Lakshmanan
f973eeb491
patch 8.2.3871: list.c contains code for dict and blob
...
Problem: List.c contains code for dict and blob.
Solution: Refactor to put code where it belongs. (Yegappan Lakshmanan,
closes #9386 )
2021-12-22 18:19:26 +00:00
Yegappan Lakshmanan
d92813a598
patch 8.2.3867: implementation of some list functions too complicated
...
Problem: Implementation of some list functions too complicated.
Solution: Refactor do_sort_uniq(), f_count() and extend() (Yegappan
Lakshmanan, closes #9378 )
2021-12-21 13:19:42 +00:00
Yegappan Lakshmanan
389b72196e
patch 8.2.3849: functions implementing reduce and map are too long
...
Problem: Functions implementing reduce and map are too long.
Solution: Use a function for each type of value. Add a few more test cases
and add to the help. (Yegappan Lakshmanan, closes #9370 )
2021-12-19 10:35:15 +00:00
rbtnn
0ccb5842f5
patch 8.2.3848: cannot use reduce() for a string
...
Problem: Cannot use reduce() for a string.
Solution: Make reduce() work with a string. (Naruhiko Nishino, closes #9366 )
2021-12-18 18:33:46 +00:00
Bram Moolenaar
2d877599ee
patch 8.2.3822: leaking memory in map() and filter(), no string in Vim9
...
Problem: Leaking memory in map() and filter(), cannot use a string argument
in Vim9 script.
Solution: Fix the leak, adjust the argument check, also run the tests as
Vim9 script. (Yegappan Lakshmanan, closes #9354 )
2021-12-16 08:21:09 +00:00
rbtnn
c479ce032f
patch 8.2.3818: cannot filter or map characters in a string
...
Problem: Cannot filter or map characters in a string.
Solution: Make filter() and map() work on a string. (Naruhiko Nishino,
closes #9327 )
2021-12-15 19:14:54 +00:00
Bram Moolenaar
851f86b951
patch 8.2.3796: the funcexe_T struct members are not named consistently
...
Problem: The funcexe_T struct members are not named consistently.
Solution: Prefix "fe_" to all the members.
2021-12-13 14:26:44 +00:00
Bram Moolenaar
40bcec1bac
patch 8.2.3750: error messages are everywhere
...
Problem: Error messages are everywhere.
Solution: Move more error messages to errors.h and adjust the names.
2021-12-05 22:19:27 +00:00
Yasuhiro Matsumoto
c04f62346b
patch 8.2.3449: sort fails if the sort compare function returns 999
...
Problem: Sort fails if the sort compare function returns 999.
Solution: Adjust value to -1 / 0 / 1. (Yasuhiro Matsumoto, closes #8884 )
2021-09-19 17:01:39 +02:00
Bram Moolenaar
b3bf33a7b2
patch 8.2.3427: double free when list is copied
...
Problem: Double free when list is copied.
Solution: Allocate the type when making a copy. (closes #8862 )
Clear the type for flattennew(). Avoid a memory leak when
flattennew() fails.
2021-09-11 20:20:38 +02:00
Bram Moolenaar
efc084e335
patch 8.2.3422: Vim9: no failure if return type differs from returned var
...
Problem: Vim9: no failure if return type differs from returned variable.
Solution: Copy type when copying a list. (closes #8847 )
2021-09-09 22:30:52 +02:00
Bram Moolenaar
89071cb6a1
patch 8.2.3338: Vim9: no type check when assigning a list range
...
Problem: Vim9: no type check when assigning a list range. (Naohiro Ono)
Solution: Check the member type. (closes #8750 )
2021-08-13 18:20:09 +02:00
Bram Moolenaar
92f05f21af
patch 8.2.3336: behavior of negative index in list change changed
...
Problem: Behavior of negative index in list change changed. (Naruhiko
Nishino)
Solution: Only change it for Vim9 script. (closes #8749 )
2021-08-12 21:12:56 +02:00
Bram Moolenaar
ef98257593
patch 8.2.3335: Vim9: not enough tests run with Vim9
...
Problem: Vim9: not enough tests run with Vim9.
Solution: Run a few more tests in Vim9 script and :def function. Fix that
items(), keys() and values9) return zero for a NULL dict.
Make join() return an empty string for a NULL list. Make sort()
return an empty list for a NULL list.
2021-08-12 19:27:57 +02:00
Bram Moolenaar
4f0884d6e2
patch 8.2.3332: Vim9: cannot assign to range in list
...
Problem: Vim9: cannot assign to range in list.
Solution: Implement overwriting a list range.
2021-08-11 21:49:23 +02:00
Yegappan Lakshmanan
8ee52affe7
patch 8.2.3320: some local functions are not static
...
Problem: Some local functions are not static.
Solution: Add "static". Move snprintf() related code to strings.c.
(Yegappan Lakshmanan, closes #8734 )
2021-08-09 19:59:06 +02:00
Sean Dewar
80d7395dcf
patch 8.2.3284: no error for insert() or remove() changing a locked blob
...
Problem: No error for insert() or remove() changing a locked blob.
Solution: Check a blob is not locked before changing it. (Sean Dewar,
closes #8696 )
2021-08-04 19:25:54 +02:00
Yegappan Lakshmanan
4490ec4e83
patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
...
Problem: Vim9: runtime and compile time type checks are not the same.
Solution: Add more runtime type checks for builtin functions. (Yegappan
Lakshmanan, closes #8646 )
2021-07-27 22:00:44 +02:00
Yegappan Lakshmanan
0ad871dc4d
patch 8.2.3206: Vim9: argument types are not checked at compile time
...
Problem: Vim9: argument types are not checked at compile time.
Solution: Add several more type checks. (Yegappan Lakshmanan, closes #8611 )
2021-07-23 20:37:56 +02:00
Bram Moolenaar
7a3fe3e180
patch 8.2.3200: Vim9: hard to guess where a type error is given
...
Problem: Vim9: hard to guess where a type error is given.
Solution: Add the function name where possible. (closes #8608 )
2021-07-22 14:58:47 +02:00
Bram Moolenaar
e29a27f6f8
patch 8.2.3190: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move error messages to errors.h and give them a clear name.
2021-07-20 21:07:36 +02:00
Yegappan Lakshmanan
83494b4ac6
patch 8.2.3188: Vim9: argument types are not checked at compile time
...
Problem: Vim9: argument types are not checked at compile time.
Solution: Add several more type checks, also at runtime. (Yegappan
Lakshmanan, closes #8587 )
2021-07-20 17:51:51 +02:00
Bram Moolenaar
885971e2f5
patch 8.2.3182: Vim9: crash when using removing items from a constant list
...
Problem: Vim9: crash when using removing items from a constant list.
(Yegappan Lakshmanan)
Solution: When a list was allocated with items copy them.
2021-07-18 22:25:29 +02:00
Bram Moolenaar
90fba5627b
patch 8.2.3133: Vim9: memory leak when add() fails
...
Problem: Vim9: memory leak when add() fails.
Solution: Allocate listitem_T after type check.
2021-07-09 19:17:55 +02:00
Bram Moolenaar
f32f099761
patch 8.2.3127: Vim9: no error when adding number to list of string
...
Problem: Vim9: no error when adding number to list of string.
Solution: Check the value type. (closes #8529 )
2021-07-08 20:53:40 +02:00
Bram Moolenaar
108010aa47
patch 8.2.3069: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move some error messages to errors.h. Use clearer names.
2021-06-27 22:03:33 +02:00
Bram Moolenaar
39211cba72
patch 8.2.2782: Vim9: blob operations not fully tested
...
Problem: Vim9: blob operations not fully tested.
Solution: Make more blob tests run in Vim9 script. Fix filter(). Make
insert() give an error for a null blob, like add().
2021-04-18 15:48:04 +02:00
Bram Moolenaar
b7c21afef1
patch 8.2.2781: add() silently skips when adding to null list or blob
...
Problem: Add() silently skips when adding to null list or blob.
Solution: Give an error in Vim9 script. Allocate blob when it is NULL like
with list and dict.
2021-04-18 14:12:31 +02:00
Bram Moolenaar
f2253963c2
patch 8.2.2759: Vim9: for loop infers type of loop variable
...
Problem: Vim9: for loop infers type of loop variable.
Solution: Do not get the member type. (closes #8102 )
2021-04-13 20:53:13 +02:00
Bram Moolenaar
dcae51facc
patch 8.2.2738: extending a list with itself can give wrong result
...
Problem: Extending a list with itself can give wrong result.
Solution: Remember the item before where the insertion happens and skip to
after the already inserted items. (closes #1112 )
2021-04-08 20:10:10 +02:00
Bram Moolenaar
108cf0153c
patch 8.2.2621: typval2type() cannot handle recursive structures
...
Problem: typval2type() cannot handle recursive structures.
Solution: Use copyID. (closes #7979 )
2021-03-18 22:15:04 +01:00
Bram Moolenaar
027c4ab4d2
patch 8.2.2537: Vim9: crash when map() fails
...
Problem: Vim9: crash when map() fails.
Solution: Clear typval before using it. (closes #7884 )
2021-02-21 16:20:18 +01:00
Bram Moolenaar
5b5ae29bd3
patch 8.2.2533: Vim9: cannot use a range with :unlet
...
Problem: Vim9: cannot use a range with :unlet.
Solution: Implement ISN_UNLETRANGE.
2021-02-20 17:04:02 +01:00
Bram Moolenaar
f785aa1354
patch 8.2.2501: not always clear where an error is reported
...
Problem: Not always clear where an error is reported.
Solution: Add the where_T structure and pass it around. (closes #7796 )
2021-02-11 21:19:34 +01:00
Bram Moolenaar
ba98fb54ae
patch 8.2.2486: Vim9: some errors for white space do not show context
...
Problem: Vim9: some errors for white space do not show context.
Solution: Include the text at the error.
2021-02-07 18:06:29 +01:00
Bram Moolenaar
c3fc75db02
patch 8.2.2480: Vim9: some errors for white space do not show context
...
Problem: Vim9: some errors for white space do not show context.
Solution: Include the text at the error.
2021-02-07 15:28:09 +01:00
Bram Moolenaar
3b69006973
patch 8.2.2449: Vim9: flatten() always changes the list type
...
Problem: Vim9: flatten() always changes the list type.
Solution: Disallow using flatten() and add flattennew().
2021-02-01 20:14:51 +01:00
Bram Moolenaar
c03f5c677a
patch 8.2.2441: Vim9: extend() does not give an error for a type mismatch
...
Problem: Vim9: extend() does not give an error for a type mismatch.
Solution: Check the type of the second argument. (closes #7760 )
2021-01-31 17:48:30 +01:00
Bram Moolenaar
239f8d9326
patch 8.2.2367: test failures on some less often used systems
...
Problem: Test failures on some less often used systems.
Solution: Adjust printf formats and types. (James McCoy, closes #7691 )
2021-01-17 13:21:20 +01:00
Bram Moolenaar
70250fb4d2
patch 8.2.2365: Vim9: no check for map() changing item type at script level
...
Problem: Vim9: no check for map() changing item type at script level.
Solution: Check the new value type.
2021-01-16 19:01:53 +01:00
Bram Moolenaar
6601b62943
patch 8.2.2344: using inclusive index for slice is not always desired
...
Problem: Using inclusive index for slice is not always desired.
Solution: Add the slice() method, which has an exclusive index. (closes
#7408 )
2021-01-13 21:47:15 +01:00
Bram Moolenaar
b0e6b51364
patch 8.2.2336: Vim9: not possible to extend dictionary with different type
...
Problem: Vim9: it is not possible to extend a dictionary with different
item types.
Solution: Add extendnew(). (closes #7666 )
2021-01-12 20:23:40 +01:00
Bram Moolenaar
75ab91ff34
patch 8.2.2325: Vim9: crash if map() changes the item type
...
Problem: Vim9: crash if map() changes the item type.
Solution: Check that the item type is still OK. (closes #7652 )
Fix problem with mapnew() on range list.
2021-01-10 22:42:50 +01:00
Bram Moolenaar
e7525c5520
patch 8.2.2318: Vim9: string and list index work differently
...
Problem: Vim9: string and list index work differently.
Solution: Make string index work like list index. (closes #7643 )
2021-01-09 13:20:37 +01:00
Bram Moolenaar
aa210a3aec
patch 8.2.2272: Vim9: extend() can violate the type of a variable
...
Problem: Vim9: extend() can violate the type of a variable.
Solution: Add the type to the dictionary or list and check items against it.
(closes #7593 )
2021-01-02 15:41:03 +01:00
Bram Moolenaar
8e7d6223f6
patch 8.2.2160: various typos
...
Problem: Various typos.
Solution: Fix spelling mistakes. (closes #7494 )
2020-12-18 19:49:56 +01:00
Bram Moolenaar
57cf4973a2
patch 8.2.2075: error for const argument to mapnew()
...
Problem: Error for const argument to mapnew().
Solution: Don't give an error. (closes #7400 )
2020-12-01 21:08:05 +01:00
Bram Moolenaar
f8ca03bf91
patch 8.2.2065: using map() and filter() on a range() is inefficient
...
Problem: Using map() and filter() on a range() is inefficient.
Solution: Do not materialize the range. (closes #7388 )
2020-11-28 20:32:29 +01:00