Mercurial > vim
annotate runtime/syntax/dosini.vim @ 32960:d5c05e15cf81 v9.0.1780
patch 9.0.1780: Vim9 type not defined during object creation
Commit: https://github.com/vim/vim/commit/618e47d1cd93954bad26d47e5353b4f1432daa5e
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Aug 22 21:29:28 2023 +0200
patch 9.0.1780: Vim9 type not defined during object creation
Problem: Vim9 type not defined during object creation
Solution: Define type during object creation and not during class
definition, parse mulit-line member initializers, fix lock
initialization
If type is not specified for a member, set it during object creation
instead of during class definition. Add a runtime type check for the
object member initialization expression
Also, while at it, when copying an object or class, make sure the lock
is correctly initialized.
And finally, parse multi-line member initializers correctly.
closes: #11957
closes: #12868
closes: #12869
closes: #12881
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 22 Aug 2023 21:45:02 +0200 |
parents | e8db0e2c86e6 |
children | a2ba39a96e85 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
3082 | 2 " Language: Configuration File (ini file) for MSDOS/MS Windows |
32725
5852c4c1c4bf
Update syntax/dosini.vim to the latest version (#12764)
Christian Brabandt <cb@256bit.org>
parents:
14864
diff
changeset
|
3 " Version: 2.3 |
3082 | 4 " Original Author: Sean M. McKee <mckee@misslink.net> |
5 " Previous Maintainer: Nima Talebi <nima@it.net.au> | |
14864 | 6 " Current Maintainer: Hong Xu <hong@topbug.net> |
3224 | 7 " Homepage: http://www.vim.org/scripts/script.php?script_id=3747 |
14864 | 8 " Repository: https://github.com/xuhdev/syntax-dosini.vim |
32954
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
9 " Last Change: 2023 Aug 20 |
1125 | 10 |
7 | 11 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3224
diff
changeset
|
12 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3224
diff
changeset
|
13 if exists("b:current_syntax") |
7 | 14 finish |
15 endif | |
16 | |
32954
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
17 " using of line-continuation requires cpo&vim |
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
18 let s:cpo_save = &cpo |
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
19 set cpo&vim |
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
20 |
7 | 21 " shut case off |
22 syn case ignore | |
23 | |
14864 | 24 syn match dosiniLabel "^.\{-}\ze\s*=" nextgroup=dosiniNumber,dosiniValue |
25 syn match dosiniValue "=\zs.*" | |
26 syn match dosiniNumber "=\zs\s*\d\+\s*$" | |
27 syn match dosiniNumber "=\zs\s*\d*\.\d\+\s*$" | |
28 syn match dosiniNumber "=\zs\s*\d\+e[+-]\=\d\+\s*$" | |
3082 | 29 syn region dosiniHeader start="^\s*\[" end="\]" |
30 syn match dosiniComment "^[#;].*$" | |
32725
5852c4c1c4bf
Update syntax/dosini.vim to the latest version (#12764)
Christian Brabandt <cb@256bit.org>
parents:
14864
diff
changeset
|
31 syn region dosiniSection start="\s*\[.*\]" end="\ze\s*\[.*\]" fold |
5852c4c1c4bf
Update syntax/dosini.vim to the latest version (#12764)
Christian Brabandt <cb@256bit.org>
parents:
14864
diff
changeset
|
32 \ contains=dosiniLabel,dosiniValue,dosiniNumber,dosiniHeader,dosiniComment |
7 | 33 |
34 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3224
diff
changeset
|
35 " Only when an item doesn't have highlighting yet |
7 | 36 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
37 hi def link dosiniNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
38 hi def link dosiniHeader Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
39 hi def link dosiniComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
40 hi def link dosiniLabel Type |
14864 | 41 hi def link dosiniValue String |
7 | 42 |
43 | |
44 let b:current_syntax = "dosini" | |
45 | |
32954
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
46 let &cpo = s:cpo_save |
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
47 unlet s:cpo_save |
e8db0e2c86e6
runtime(dosini): save and restore cpo value in syntax script
Christian Brabandt <cb@256bit.org>
parents:
32725
diff
changeset
|
48 |
3082 | 49 " vim: sts=2 sw=2 et |