annotate runtime/syntax/gdresource.vim @ 34264:cce6b834635c v9.1.0071

patch 9.1.0071: Need a diff() Vim script function Commit: https://github.com/vim/vim/commit/fa37835b8c0ed0f83952978fca4c332335ca7c46 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Feb 1 22:05:27 2024 +0100 patch 9.1.0071: Need a diff() Vim script function Problem: Need a diff() Vim script function Solution: Add the diff() Vim script function using the xdiff internal diff library, add support for "unified" and "indices" mode. (Yegappan Lakshmanan) fixes: #4241 closes: #12321 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 01 Feb 2024 22:30:03 +0100
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