annotate runtime/syntax/gdresource.vim @ 33532:f99f5a56ff27 v9.0.2015

patch 9.0.2015: Vim9: does not handle islocked() from a method correctly Commit: https://github.com/vim/vim/commit/4c8da025ef8140168b7a09d9fe922ce4bb40f19d Author: Ernie Rael <errael@raelity.com> Date: Wed Oct 11 21:35:11 2023 +0200 patch 9.0.2015: Vim9: does not handle islocked() from a method correctly Problem: Vim9: does not handle islocked() from a method correctly Solution: Handle islocked() builtin from a method. - Setup `lval_root` from `f_islocked()`. - Add function `fill_exec_lval_root()` to get info about executing method. - `sync_root` added in get_lval to handle method member access. - Conservative approach to reference counting. closes: #13309 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ernie Rael <errael@raelity.com>
author Christian Brabandt <cb@256bit.org>
date Wed, 11 Oct 2023 21:45:04 +0200
parents ebed259f919f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29996
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file for Godot resource (scenes)
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: gdresource
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Maxim Kim <habamax@gmail.com>
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Filenames: *.tscn, *.tres
30085
ebed259f919f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29996
diff changeset
5 " Website: https://github.com/habamax/vim-gdscript
29996
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 if exists("b:current_syntax")
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 finish
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 endif
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
30085
ebed259f919f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29996
diff changeset
11 let s:keepcpo = &cpo
29996
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 set cpo&vim
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 syn match gdResourceNumber "\<0x\%(_\=\x\)\+\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 syn match gdResourceNumber "\<0b\%(_\=[01]\)\+\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 syn match gdResourceNumber "\<\d\%(_\=\d\)*\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 syn match gdResourceNumber "\<\d\%(_\=\d\)*\%(e[+-]\=\d\%(_\=\d\)*\)\=\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 syn match gdResourceNumber "\<\d\%(_\=\d\)*\.\%(e[+-]\=\d\%(_\=\d\)*\)\=\%(\W\|$\)\@="
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 syn match gdResourceNumber "\%(^\|\W\)\@1<=\%(\d\%(_\=\d\)*\)\=\.\d\%(_\=\d\)*\%(e[+-]\=\d\%(_\=\d\)*\)\=\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 syn keyword gdResourceKeyword true false
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 syn region gdResourceString
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 \ start=+[uU]\="+ end='"' skip='\\\\\|\\"'
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 \ contains=@Spell keepend
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 " Section
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 syn region gdResourceSection matchgroup=gdResourceSectionDelimiter
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 \ start='^\[' end=']\s*$'
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 \ oneline keepend
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 \ contains=gdResourceSectionName,gdResourceSectionAttribute
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 syn match gdResourceSectionName '\[\@<=\S\+' contained skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 syn match gdResourceSectionAttribute '\S\+\s*=\s*\S\+'
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 \ skipwhite keepend contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 \ contains=gdResourceSectionAttributeName,gdResourceSectionAttributeValue
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 syn match gdResourceSectionAttributeName '\S\+\ze\(\s*=\)' skipwhite contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 syn match gdResourceSectionAttributeValue '\(=\s*\)\zs\S\+\ze' skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 \ contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 \ contains=gdResourceString,gdResourceNumber,gdResourceKeyword
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 " Section body
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 syn match gdResourceAttribute '^\s*\S\+\s*=.*$'
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 \ skipwhite keepend
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 \ contains=gdResourceAttributeName,gdResourceAttributeValue
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 syn match gdResourceAttributeName '\S\+\ze\(\s*=\)' skipwhite contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 syn match gdResourceAttributeValue '\(=\s*\)\zs.*$' skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 \ contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 \ contains=gdResourceString,gdResourceNumber,gdResourceKeyword
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 hi def link gdResourceNumber Constant
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 hi def link gdResourceKeyword Constant
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 hi def link gdResourceSectionName Statement
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 hi def link gdResourceSectionDelimiter Delimiter
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 hi def link gdResourceSectionAttributeName Type
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 hi def link gdResourceAttributeName Identifier
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 hi def link gdResourceString String
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 let b:current_syntax = "gdresource"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 let &cpo = s:keepcpo
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 unlet s:keepcpo