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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
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
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
4 " Original Author: Sean M. McKee <mckee@misslink.net>
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
5 " Previous Maintainer: Nima Talebi <nima@it.net.au>
14864
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
6 " Current Maintainer: Hong Xu <hong@topbug.net>
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
7 " Homepage: http://www.vim.org/scripts/script.php?script_id=3747
14864
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
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
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
10
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " shut case off
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
14864
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
24 syn match dosiniLabel "^.\{-}\ze\s*=" nextgroup=dosiniNumber,dosiniValue
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
25 syn match dosiniValue "=\zs.*"
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
26 syn match dosiniNumber "=\zs\s*\d\+\s*$"
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
27 syn match dosiniNumber "=\zs\s*\d*\.\d\+\s*$"
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
28 syn match dosiniNumber "=\zs\s*\d\+e[+-]\=\d\+\s*$"
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
29 syn region dosiniHeader start="^\s*\[" end="\]"
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
40ef13331e02 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
41 hi def link dosiniValue String
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 let b:current_syntax = "dosini"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
49 " vim: sts=2 sw=2 et