annotate runtime/syntax/gdscript.vim @ 30186:d9768ddc26fd v9.0.0429

patch 9.0.0429: not all keys are tested for the MS-Windows GUI Commit: https://github.com/vim/vim/commit/0adae2da17598669e442ba38547ab18a6c1406de Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Fri Sep 9 17:39:02 2022 +0100 patch 9.0.0429: not all keys are tested for the MS-Windows GUI Problem: Not all keys are tested for the MS-Windows GUI. Solution: Add more key codes to the list. (Yegappan Lakshmanan, closes #11097)
author Bram Moolenaar <Bram@vim.org>
date Fri, 09 Sep 2022 18:45:03 +0200
parents ebed259f919f
children 0827d3d6d8c0
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 gdscript
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: gdscript
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Maxim Kim <habamax@gmail.com>
30085
ebed259f919f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29996
diff changeset
4 " Website: https://github.com/habamax/vim-gdscript
29996
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Filenames: *.gd
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 syntax sync maxlines=100
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 syn keyword gdscriptConditional if else elif match
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 syn keyword gdscriptRepeat for while break continue
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 syn keyword gdscriptOperator is as not and or in
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 match gdscriptClass "\v<\u\w+>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn match gdscriptConstant "\<[_A-Z]\+[0-9_A-Z]*\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 syn match gdscriptBlockStart ":\s*$"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 syn keyword gdscriptKeyword null self owner parent tool
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 syn keyword gdscriptBoolean false true
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 syn keyword gdscriptStatement remote master puppet remotesync mastersync puppetsync sync
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 syn keyword gdscriptStatement return pass
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 syn keyword gdscriptStatement static const enum
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 syn keyword gdscriptStatement breakpoint assert
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 syn keyword gdscriptStatement onready
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 syn keyword gdscriptStatement class_name extends
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 syn keyword gdscriptType void bool int float String contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 syn keyword gdscriptStatement var nextgroup=gdscriptTypeDecl skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 syn keyword gdscriptStatement const nextgroup=gdscriptTypeDecl skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 syn match gdscriptTypeDecl "\h\w*\s*:\s*\h\w*" contains=gdscriptOperator,gdscriptType,gdscriptClass contained skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 syn match gdscriptTypeDecl "->\s*\h\w*" contains=gdscriptOperator,gdscriptType,gdscriptClass skipwhite
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 syn keyword gdscriptStatement export nextgroup=gdscriptExportTypeDecl skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 syn match gdscriptExportTypeDecl "(.\{-}[,)]" contains=gdscriptOperator,gdscriptType,gdscriptClass contained skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 syn keyword gdscriptStatement setget nextgroup=gdscriptSetGet,gdscriptSetGetSeparator skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 syn match gdscriptSetGet "\h\w*" nextgroup=gdscriptSetGetSeparator display contained skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 syn match gdscriptSetGetSeparator "," nextgroup=gdscriptSetGet display contained skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 syn keyword gdscriptStatement class func signal nextgroup=gdscriptFunctionName skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 syn match gdscriptFunctionName "\h\w*" nextgroup=gdscriptFunctionParams display contained skipwhite
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 syn match gdscriptFunctionParams "(.*)" contains=gdscriptTypeDecl display contained skipwhite
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 syn match gdscriptNode "\$\h\w*\%(/\h\w*\)*"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 syn match gdscriptComment "#.*$" contains=@Spell,gdscriptTodo
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 syn region gdscriptString matchgroup=gdscriptQuotes
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 \ contains=gdscriptEscape,@Spell
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 syn region gdscriptString matchgroup=gdscriptTripleQuotes
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 \ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 \ contains=gdscriptEscape,@Spell
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 syn match gdscriptEscape +\\[abfnrtv'"\\]+ contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 syn match gdscriptEscape "\\$"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 " Numbers
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 syn match gdscriptNumber "\<0x\%(_\=\x\)\+\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 syn match gdscriptNumber "\<0b\%(_\=[01]\)\+\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 syn match gdscriptNumber "\<\d\%(_\=\d\)*\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 syn match gdscriptNumber "\<\d\%(_\=\d\)*\%(e[+-]\=\d\%(_\=\d\)*\)\=\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 syn match gdscriptNumber "\<\d\%(_\=\d\)*\.\%(e[+-]\=\d\%(_\=\d\)*\)\=\%(\W\|$\)\@="
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 syn match gdscriptNumber "\%(^\|\W\)\@1<=\%(\d\%(_\=\d\)*\)\=\.\d\%(_\=\d\)*\%(e[+-]\=\d\%(_\=\d\)*\)\=\>"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 " XXX, TODO, etc
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 syn keyword gdscriptTodo TODO XXX FIXME HACK NOTE BUG contained
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 hi def link gdscriptStatement Statement
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 hi def link gdscriptKeyword Keyword
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 hi def link gdscriptConditional Conditional
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 hi def link gdscriptBoolean Boolean
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 hi def link gdscriptOperator Operator
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 hi def link gdscriptRepeat Repeat
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 hi def link gdscriptSetGet Function
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 hi def link gdscriptFunctionName Function
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 hi def link gdscriptClass Type
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 hi def link gdscriptConstant Constant
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 hi def link gdscriptBuiltinStruct Typedef
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 hi def link gdscriptComment Comment
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 hi def link gdscriptString String
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 hi def link gdscriptQuotes String
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 hi def link gdscriptTripleQuotes String
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 hi def link gdscriptEscape Special
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 hi def link gdscriptNode PreProc
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 hi def link gdscriptType Type
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 hi def link gdscriptNumber Number
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 hi def link gdscriptBlockStart Special
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 hi def link gdscriptTodo Todo
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 let b:current_syntax = "gdscript"
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 let &cpo = s:keepcpo
e37754a13778 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 unlet s:keepcpo