1
0
forked from aniani/vim

745 Commits

Author SHA1 Message Date
Bram Moolenaar
fa46ead31a patch 8.2.3869: Vim9: type checking for "any" is inconsistent
Problem:    Vim9: type checking for "any" is inconsistent.
Solution:   Always use a runtime type check for using "any" for a more
            specific type.
2021-12-22 13:18:39 +00:00
Bram Moolenaar
dc7c366f3a patch 8.2.3860: Vim9: codecov struggles with the file size
Problem:    Vim9: codecov struggles with the file size.
Solution:   Split vim9compile.c into four files.
2021-12-20 15:04:29 +00:00
Bram Moolenaar
a99fb23842 patch 8.2.3859: Vim9: some code lines not tested
Problem:    Vim9: some code lines not tested.
Solution:   Add a few specific tests.
2021-12-20 12:25:03 +00:00
Bram Moolenaar
003312b1d2 patch 8.2.3858: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Add tests for :try/:catch and :redir. Add missing type check.
2021-12-20 10:55:35 +00:00
Bram Moolenaar
fea43e44c0 patch 8.2.3856: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Run more expression tests also with Vim9. Fix an uncovered
            problem.
2021-12-19 21:34:05 +00:00
Bram Moolenaar
f47c5a8e2d patch 8.2.3852: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Also run existing tests for Vim9 script.  Make errors more
            consistent.
2021-12-19 15:17:21 +00:00
Bram Moolenaar
44a8977de4 patch 8.2.3844: Vim9: no type error if assigning func(number) to func(string)
Problem:    Vim9: no type error if assigning a value with type func(number) to
            a variable of type func(string).
Solution:   Use check_type_maybe(): return MAYBE if a runtime type check is
            useful.  (issue #8492)
2021-12-18 12:31:33 +00:00
Bram Moolenaar
e124204c4f patch 8.2.3830: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move more error messages to errors.h.
2021-12-16 20:56:57 +00:00
Bram Moolenaar
b15cf44c1d patch 8.2.3826: Vim9: using "g:Func" as funcref doesn't work in :def function
Problem:    Vim9: using "g:Func" as a funcref does not work in a :def
            function.
Solution:   Include "g:" in the function name. (closes #9336)
2021-12-16 15:49:43 +00:00
Bram Moolenaar
9fffef9f35 patch 8.2.3775: Vim9: lambda compiled without outer context when debugging
Problem:    Vim9: lambda compiled without outer context when debugging.
Solution:   When compiling a lambda for debugging also compile it without.
            (closes #9302)
2021-12-10 16:55:58 +00:00
Bram Moolenaar
dcb53be441 patch 8.2.3765: Vim9: cannot use a lambda for 'opfunc' and others
Problem:    Vim9: cannot use a lambda for 'opfunc' and others.
Solution:   Convert the lambda to a string.
2021-12-09 14:23:43 +00:00
Yegappan Lakshmanan
6409553b6e patch 8.2.3751: cannot assign a lambda to an option that takes a function
Problem:    Cannot assign a lambda to an option that takes a function.
Solution:   Automatically convert the lambda to a string. (Yegappan
            Lakshmanan, closes #9286)
2021-12-06 11:03:55 +00:00
Bram Moolenaar
b579f6ebbf patch 8.2.3733: Vim9: using "legacy" before range does not work
Problem:    Vim9: using "legacy" before range does not work.
Solution:   Skip over range before parsing command. (closes #9270)
2021-12-04 11:57:00 +00:00
Bram Moolenaar
db9ff9ab5d patch 8.2.3717: Vim9: error for constant list size is only given at runtime
Problem:    Vim9: error for constant list size is only given at runtime.
Solution:   Give the error at compile time if possible.
2021-12-01 17:38:01 +00:00
Bram Moolenaar
e4eed8c6db patch 8.2.3716: Vim9: range without a command is not compiled
Problem:    Vim9: range without a command is not compiled.
Solution:   Add the ISN_EXECRANGE byte code.
2021-12-01 15:22:56 +00:00
Bram Moolenaar
56a8ffdb6e patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Problem:    Vim9: memory leak when compiling :elseif fails.
Solution:   Cleanup ppconst.
2021-12-01 10:10:22 +00:00
Bram Moolenaar
3d2e031d4f patch 8.2.3710: Vim9: backtick expression expanded for :global
Problem:    Vim9: backtick expression expanded for :global.
Solution:   Check the following command.
2021-12-01 09:27:20 +00:00
Bram Moolenaar
fad2742d53 patch 8.2.3709: Vim9: backtick expression expanded when not desired
Problem:    Vim9: backtick expression expanded when not desired.
Solution:   Only expand a backtick expression for commands that expand their
            argument.  Remove a few outdated TODO comments.
2021-11-30 21:58:19 +00:00
Bram Moolenaar
90770b746e patch 8.2.3707: Vim9: constant expression of elseif not recognized
Problem:    Vim9: constant expression of elseif not recognized.
Solution:   Set instruction count before generating the expression.
2021-11-30 20:57:38 +00:00
Bram Moolenaar
ab36e6ae7b patch 8.2.3704: Vim9: cannot use a list declaration in a :def function
Problem:    Vim9: cannot use a list declaration in a :def function.
Solution:   Make it work.
2021-11-30 16:14:49 +00:00
Bram Moolenaar
c750d91a07 patch 8.2.3701: Vim9: invalid LHS is not possible
Problem:    Vim9: invalid LHS is not possible.
Solution:   Remove unreachable error message.
2021-11-29 22:02:12 +00:00
Bram Moolenaar
38453528c3 patch 8.2.3692: Vim9: cannot use :func inside a :def function
Problem:    Vim9: cannot use :func inside a :def function.
Solution:   Make it work.
2021-11-28 22:00:12 +00:00
Mike Williams
cc9d725bbb patch 8.2.3655: compiler warning for using size_t for int
Problem:    Compiler warning for using size_t for int.
Solution:   Add a type cast. (Mike Williams, closes #9199)
2021-11-23 12:35:57 +00:00
Bram Moolenaar
3b3755fe19 patch 8.2.3650: Vim9: for loop variable can be a list member
Problem:    Vim9: for loop variable can be a list member.
Solution:   Check for valid variable name. (closes #9179)
2021-11-22 20:10:18 +00:00
Bram Moolenaar
844fb64a60 patch 8.2.3560: using freed memory with lambda
Problem:    Using freed memory with lambda.
Solution:   Do not free lines early, keep them until the expression is
            finished.
2021-10-23 13:32:30 +01:00
Bram Moolenaar
7f32092b91 patch 8.2.3504: Vim9: warning for signed vs unsigned
Problem:    Vim9: warning for signed vs unsigned.
Solution:   Add type cast.
2021-10-13 15:28:28 +01:00
Bram Moolenaar
7b82926892 patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Problem:    Vim9: using g:pat:cmd is confusing.
Solution:   Do not recognize g: as the :global command.  Also for s:pat:repl.
            (closes #8982)
2021-10-13 15:04:34 +01:00
Bram Moolenaar
3dfe2e0fb8 patch 8.2.3443: Vim9: memory leak when and/or fails
Problem:    Vim9: memory leak when and/or fails.
Solution:   Also clear the growarray when the length is zero.
2021-09-16 20:14:51 +02:00
Bram Moolenaar
1a7ee4dd11 patch 8.2.3442: Vim9: || and && are not handled at compile time
Problem:    Vim9: || and && are not handled at compile time when possible.
Solution:   When using constants generate fewer instructions.
2021-09-16 16:15:07 +02:00
Bram Moolenaar
b1b6f4de2b patch 8.2.3435: Vim9: dict is not passed to dict function
Problem:    Vim9: dict is not passed to dict function.
Solution:   Keep the dict used until a function call.
2021-09-13 18:25:54 +02:00
Bram Moolenaar
07802044b9 patch 8.2.3423: Vim9: list += list creates a new list in :def function
Problem:    Vim9: list += list creates a new list in :def function.
Solution:   Append to the existing list.
2021-09-09 23:01:14 +02:00
Bram Moolenaar
4799cef85c patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Problem:    Vim9: no warning that "@r" does not do anything.
Solution:   Give a "no effect" error. (closes #8779)
2021-08-25 22:37:36 +02:00
Bram Moolenaar
5ca5cc6412 patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Problem:    Vim9: :$ENV cannot be followed by ->func() in next line.
Solution:   Use "$ENV" as the start of an expression. (closes #8790)
2021-08-24 21:56:03 +02:00
Bram Moolenaar
093165c899 patch 8.2.3366: Vim9: debugging elseif does not stop before condition
Problem:    Vim9: debugging elseif does not stop before condition.
Solution:   Move debug statement to after the jump. (closes #8781)
2021-08-22 13:35:31 +02:00
Bram Moolenaar
bf5f287833 patch 8.2.3365: Vim9: cannot use option for all operations
Problem:    Vim9: cannot use option for all operations.
Solution:   Recognize more operations. (closes #8779)
2021-08-21 20:50:35 +02:00
rbtnn
bebf06954e patch 8.2.3364: Vim9: crash when :for is skipped
Problem:    Vim9: crash when :for is skipped.
Solution:   Skip more code generation. (Naruhiko Nishino, closes #8777)
2021-08-21 17:26:50 +02:00
rbtnn
d895b1d918 patch 8.2.3361: Vim9: crash with nested :while
Problem:    Vim9: crash with nested :while.
Solution:   Handle skipping better. (Naruhiko Nishino, closes #8778)
2021-08-20 20:54:25 +02:00
Bram Moolenaar
cd6b4f3001 patch 8.2.3353: Vim9: type of argument for negate not checked at compile time
Problem:    Vim9: type of argument for negate not checked at compile time.
Solution:   Add a compile time check.
2021-08-15 20:36:28 +02:00
Bram Moolenaar
aacc966c5d patch 8.2.3339: Vim9: cannot lock a member in a local dict
Problem:    Vim9: cannot lock a member in a local dict.
Solution:   Get the local dict from the stack and pass it to get_lval().
2021-08-13 19:40:51 +02:00
Bram Moolenaar
bd77aa9274 patch 8.2.3334: 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
            islocked().  Fix error for locking local variable.
2021-08-12 17:06:05 +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
Bram Moolenaar
6e48b84c5f patch 8.2.3326: Vim9: no error passing an empty list of the wrong type
Problem:    Vim9: no error passing an empty list of the wrong type.
Solution:   Use ISN_SETTYPE also for "list<any>". (closes #8732)
2021-08-10 22:52:02 +02:00
Bram Moolenaar
917c46abe5 patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Problem:    Vim9: Cannot use :silent with :endwhile.
Solution:   Allow for using the :silent modifier. (closes #8737)
2021-08-10 19:53:01 +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
Bram Moolenaar
267359902c patch 8.2.3314: behavior of exists() in a :def function is unpredictable
Problem:    Behavior of exists() in a :def function is unpredictable.
Solution:   Add exists_compiled().
2021-08-08 14:43:22 +02:00
Bram Moolenaar
e525bdda3a patch 8.2.3312: Vim9: after "if false" line breaks in expression not skipped
Problem:    Vim9: after "if false" line breaks in expression not skipped.
Solution:   Do parse the expression. (closes #8723)
2021-08-07 18:12:40 +02:00
Bram Moolenaar
4270d8b762 patch 8.2.3310: Vim9: unpack assignment does not mention source of type error
Problem:    Vim9: unpack assignment does not mention source of type error.
Solution:   Mention the argument number. (closes #8719)
2021-08-07 16:30:42 +02:00
Bram Moolenaar
7de6262373 patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Problem:    Vim9: :echoconsole cannot access local variables.
Solution:   Handle like other :echo commands. (closes #8708)
2021-08-07 15:05:47 +02:00
rbtnn
8493499880 patch 8.2.3305: Vim9: :finally in skipped block not handled correctly
Problem:    Vim9: :finally in skipped block not handled correctly.
Solution:   Check whether :finally is in a skipped block. (Naruhiko Nishino,
            closes #8724)
2021-08-07 13:26:53 +02:00
Bram Moolenaar
5671f3f076 patch 8.2.3299: Vim9: exists() does not handle much at compile time
Problem:    Vim9: exists() does not handle much at compile time.
Solution:   Handle variable names. (closes #8688)
2021-08-05 22:48:11 +02:00