1
0
forked from aniani/vim

745 Commits

Author SHA1 Message Date
Bram Moolenaar
63b9173693 patch 8.2.3297: cannot use all commands inside a {} block
Problem:    Cannot use all commands inside a {} block after :command and
            :autocmd.
Solution:   Do consider \n to separate commands. (closes #8620)
2021-08-05 20:40:03 +02:00
Bram Moolenaar
af647e76ca patch 8.2.3296: Vim9: cannot add a number to a float
Problem:    Vim9: cannot add a number to a float.
Solution:   Accept a number if the destination is a float. (closes #8703)
2021-08-05 19:01:17 +02:00
Zdenek Dohnal
9fe17d473a patch 8.2.3290: Vim9: compiling dict may use pointer after free
Problem:    Vim9: compiling dict may use pointer after free and leak memory on
            failure.
Solution:   Pass a pointer to generate_PUSHS().  (Zdenek Dohnal, closes #8699)
2021-08-04 22:30:52 +02:00
Bram Moolenaar
7bf9a07bd7 patch 8.2.3278: Vim9: error when adding 1 to float
Problem:    Vim9: error when adding 1 to float.
Solution:   Accept t_number_bool. (closes #8687)
2021-08-02 21:55:15 +02:00
Bram Moolenaar
c3160727b9 patch 8.2.3277: Vim9: compiled has() does not work properly
Problem:    Vim9: compiled has() does not work properly.
Solution:   Fix check for has() vs exists().
2021-08-02 21:12:05 +02:00
Bram Moolenaar
bb7ee7abe1 patch 8.2.3276: Vim9: exists() can only be evaluated at runtime
Problem:    Vim9: exists() can only be evaluated at runtime.
Solution:   Evaluate at compile time for option name literals. (closes #8437)
2021-08-02 20:06:50 +02:00
Bram Moolenaar
35578168be patch 8.2.3275: optimizer can use hints about ga_grow() normally succeeding
Problem:    Optimizer can use hints about ga_grow() normally succeeding.
Solution:   Use GA_GROW_FAILS() and GA_GROW_OK() in several places. (Dominique
            Pellé, issue #8635)
2021-08-02 19:10:38 +02:00
Bram Moolenaar
e4db17fb6e patch 8.2.3271: Vim9: cannot use :command or :au with block in :def function
Problem:    Vim9: cannot use :command or :au with a block in a :def function.
Solution:   Recognize the start of the block.
2021-08-01 21:19:43 +02:00
Bram Moolenaar
e97976baa7 patch 8.2.3266: Vim9: assignment with two indexes may check next line
Problem:    Vim9: assignment with two indexes may check next line.
Solution:   Limit the number of lines to avoid checking the next line when
            assiging to a LHS subscript. (closes #8660)
2021-08-01 13:17:17 +02:00
Bram Moolenaar
f5d52c90e0 patch 8.2.3263: Vim9: "..=" does not accept same types as the ".." operator
Problem:    Vim9: "..=" does not accept same types as the ".." operator.
Solution:   Convert value to string like ".." does. (issue #8664)
2021-07-31 22:51:10 +02:00
Bram Moolenaar
81530e3603 patch 8.2.3239: Vim9: no error using heredoc for a number variable
Problem:    Vim9: no error using heredoc for a number variable.
Solution:   Add a type check. (closes #8627)
2021-07-28 21:25:49 +02:00
Bram Moolenaar
d47c39775b patch 8.2.3238: Vim9: error message does not indicate the location
Problem:    Vim9: error message does not indicate the location.
Solution:   Add the relevant text. (issue #8634)
2021-07-28 20:52:13 +02:00
Bram Moolenaar
f723701de0 patch 8.2.3230: Vim9: type error when function return type is not known yet
Problem:    Vim9: type error when function return type is not known yet.
Solution:   When return type is unknown, use "any". (closes #8644)
2021-07-27 22:21:44 +02:00
Bram Moolenaar
678b207fb1 patch 8.2.3224: cannot call script-local function after :vim9cmd
Problem:    Cannot call script-local function after :vim9cmd. (Christian J.
            Robinson)
Solution:   Skip over "<SNR>123".
2021-07-26 21:10:11 +02:00
Bram Moolenaar
3c77b6a1ce patch 8.2.3222: Vim9: cannot used loop variable later as lambda argument
Problem:    Vim9: cannot used loop variable later as lambda argument.
Solution:   When not in function context check the current block ID.
            (closes #8637)
2021-07-25 18:07:00 +02:00
Bram Moolenaar
dd0b287c1e patch 8.2.3210: Vim9: searchpair() sixth argument is compiled
Problem:    Vim9: searchpair() sixth argument is compiled. (Yegappan
            Lakshmanan)
Solution:   Only compile the fifth argument.
2021-07-24 15:44:30 +02:00
Bram Moolenaar
88421d6dc8 patch 8.2.3209: Vim9: lambda doesn't find block-local variable
Problem:    Vim9: lambda doesn't find block-local variable.
Solution:   Adjust how a script-local variable is found. (closes #8614)
2021-07-24 14:14:52 +02:00
Bram Moolenaar
5a234eb18e patch 8.2.3207: Vim9: crash when compiling string fails
Problem:    Vim9: crash when compiling string fails. (Yegappan Lakshmanan)
Solution:   Adjust the type stack length.
2021-07-24 13:18:48 +02:00
Bram Moolenaar
1b862c466b patch 8.2.3205: Coverity reports a null pointer dereference
Problem:    Coverity reports a null pointer dereference.
Solution:   Change the logic to avoid Coverity gets confused.
2021-07-23 19:30:19 +02:00
Bram Moolenaar
cd268017cf patch 8.2.3203: Vim9: compiled string expression causes type error
Problem:    Vim9: compiled string expression causes type error. (Yegappan
            Lakshmanan)
Solution:   Remove the string type from the stack.
2021-07-22 19:11:08 +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
d8e44476d8 patch 8.2.3197: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move a few more error messages to errors.h.
2021-07-21 22:20:33 +02:00
Bram Moolenaar
05bd9785fd patch 8.2.3196: Vim9: bool expression with numbers only fails at runtime
Problem:    Vim9: bool expression with numbers only fails at runtime.
Solution:   Check constant to be bool at compile time. (closes #8603)
2021-07-21 21:37:28 +02:00
Bram Moolenaar
c4c5642513 patch 8.2.3195: Vim9: unclear error when passing too many arguments to lambda
Problem:    Vim9: unclear error when passing too many arguments to lambda.
Solution:   Pass the expression itself instead of "[expression]".
            (closes #8604)
2021-07-21 20:38:46 +02:00
Bram Moolenaar
63cb6567f0 patch 8.2.3191: Vim9: not enough code is tested
Problem:    Vim9: not enough code is tested.
Solution:   Use CheckLegacyAndVim9Success() in more places.  Fix uncovered
            problems.
2021-07-20 22:21:59 +02:00
Bram Moolenaar
9bb0dad0d8 patch 8.2.3187: Vim9: popup timer callback is not compiled
Problem:    Vim9: popup timer callback is not compiled.
Solution:   Compile the callback when creating the timer.
2021-07-19 22:19:29 +02:00
Bram Moolenaar
4db572eeb2 patch 8.2.3178: Vim9: the file name of an :import cannot be an expression
Problem:    Vim9: the file name of an :import cannot be an expression.
Solution:   Accept an expression that results in a string.  Do not support
            :import in a function.
2021-07-18 18:21:38 +02:00
Bram Moolenaar
47bc9c3337 patch 8.2.3174: Vim9: "legacy undo" finds "undo" variable
Problem:    Vim9: "legacy undo" finds "undo" variable.
Solution:   Do not pass lookup function to find_ex_command(). (closes #8563)
2021-07-17 21:24:56 +02:00
Bram Moolenaar
378697ac58 patch 8.2.3168: Vim9: type error for constant of type any
Problem:    Vim9: type error for constant of type any.
Solution:   Do add a runtime type check if a constant has type any.
            (closes #8570)
2021-07-15 19:23:18 +02:00
Bram Moolenaar
9e60e899ee patch 8.2.3165: Vim9: in a || expression the error line number may be wrong
Problem:    Vim9: in a || expression the error line number may be wrong.
Solution:   Save and restore the line number when checking the type.
            (closes #8569)
2021-07-15 15:40:58 +02:00
Bram Moolenaar
ffcfddc759 patch 8.2.3151: Vim9: profiling fails if nested function is also profiled
Problem:    Vim9: profiling fails if nested function is also profiled.
Solution:   Use the compile type from the outer function. (closes #8543)
2021-07-11 20:22:30 +02:00
Bram Moolenaar
5231224e11 patch 8.2.3148: Vim9: function arg type check does not handle base offset
Problem:    Vim9: function arg type check does not handle base offset.
Solution:   Take the base offset into account when checking builtin function
            argument types.
2021-07-11 18:23:19 +02:00
Bram Moolenaar
648594eaf7 patch 8.2.3147: Vim9: profiling does not work with a nested function
Problem:    Vim9: profiling does not work with a nested function.
Solution:   Also compile a nested function without profiling. (closes #8543)
            Handle that compiling may cause the table of compiled functions to
            change.
2021-07-11 17:55:01 +02:00
Bram Moolenaar
d9162550aa patch 8.2.3143: Vim9: wrong context if lambda called from profiled function
Problem:    Vim9: A lambda may be compiled with the wrong context if it is
            called from a profiled function.
Solution:   Compile the lambda with and without profiling. (closes #8543)
2021-07-11 15:26:13 +02:00
Bram Moolenaar
c323527d67 patch 8.2.3137: Vim9: no error when a line only has a variable name
Problem:    Vim9: no error when a line only has a variable name.
Solution:   Give an error when an expression is evaluated without an effect.
            (closes #8538)
2021-07-10 19:42:03 +02:00
Bram Moolenaar
5ede5b231e patch 8.2.3118: Vim9: "any" type not handled correctly in for loop
Problem:    Vim9: "any" type not handled correctly in for loop.
Solution:   Change compile time check into runtime check. (closes #8516)
2021-07-07 21:55:25 +02:00
Bram Moolenaar
efc5db5215 patch 8.2.3117: Vim9: type not properly checked in for loop
Problem:    Vim9: type not properly checked in for loop.
Solution:   Have items() return a list of lists.  Add runtime type checks.
            (closes #8515)
2021-07-07 21:21:30 +02:00
Bram Moolenaar
404557e6a6 patch 8.2.3111: Vim9: confusing error with extra whitespace before colon
Problem:    Vim9: confusing error with extra whitespace before colon.
Solution:   Check for colon after white space. (closes #8513)
2021-07-05 21:41:48 +02:00
Bram Moolenaar
6977dba04b patch 8.2.3106: Vim9: confusing line number reported for error
Problem:    Vim9: confusing line number reported for error.
Solution:   Use the start line number for the store instruction.
            (closes #8488)
2021-07-04 22:48:12 +02:00
Bram Moolenaar
e28d9b3bd4 patch 8.2.3091: Vim9: default argument expr. cannot use previous argument
Problem:    Vim9: default argument expression cannot use previous argument
Solution:   Correct argument index. (closes #8496)
2021-07-03 18:56:53 +02:00
Bram Moolenaar
6fc0161682 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Problem:    Vim9: breakpoint on "for" does not work.
Solution:   Use the right line number in ISN_DEBUG. (closes #8486)
2021-07-03 13:36:31 +02:00
Bram Moolenaar
834193afd7 patch 8.2.3078: Vim9: profile test fails
Problem:    Vim9: profile test fails.
Solution:   Make throw in :catch jump to :finally.
2021-06-30 20:39:15 +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
17d868b8b2 patch 8.2.3066: Vim9: debugging lambda does not work
Problem:    Vim9: debugging lambda does not work.
Solution:   Use the compile type of the function when compiling a lambda.
            (closes #8412)
2021-06-27 16:29:53 +02:00
Bram Moolenaar
577dc93da9 patch 8.2.3065: Vim9: error when sourcing script twice and reusing function
Problem:    Vim9: error when sourcing script twice and reusing a function
            name.
Solution:   Check if the function is dead. (closes #8463)
2021-06-27 15:35:40 +02:00
Bram Moolenaar
4d5dfe2083 patch 8.2.3054: Vim9: unpack assignment using "_" after semicolon fails
Problem:    Vim9: unpack assignment using "_" after semicolon fails.
Solution:   Drop the expression result. (closes #8453)
2021-06-26 13:59:29 +02:00
Bram Moolenaar
13e45d14ba patch 8.2.3053: Vim9: cannot assign to @@ in :def function
Problem:    Vim9: cannot assign to @@ in :def function
Solution:   Handle '@' like '"'.
2021-06-26 13:28:35 +02:00
Bram Moolenaar
ce024c3e20 patch 8.2.3052: Vim9: "legacy call" does not work
Problem:    Vim9: "legacy call" does not work.
Solution:   Do not skip "call" after "legacy". (closes #8454)
2021-06-26 13:00:49 +02:00
Bram Moolenaar
444d878324 patch 8.2.3051: Vim9: for loop with one list variable does not work
Problem:    Vim9: for loop with one list variable does not work.
Solution:   Use a separate flag for unpacking a list. (closes #8452)
2021-06-26 12:40:56 +02:00
Bram Moolenaar
22480d147f patch 8.2.3048: strange error for white space after ++ command
Problem:    Strange error for white space after ++ command.
Solution:   Check for white space explicitly. (closes #8440)
2021-06-25 21:31:09 +02:00