/usr/share/highlight/langDefs/gdscript.lang is in highlight-common 3.41-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | --[[******************************************************************************
* *
* GDScript Language Definition *
* *
* v1.0 - 2017/02/16 *
* *
******************************************************************************
GDScript language definition for Godot Engine script files:
https://godotengine.org/
Godot Engine 2.1.2.
------------------------------------------------------------------------------
Written by Tristano Ajmone:
<tajmone@gmail.com>
https://github.com/tajmone
Released into the public domain according to the Unlicense licsense:
http://unlicense.org/
------------------------------------------------------------------------------
Project repository:
https://github.com/tajmone/gdscript-highlight
------------------------------------------------------------------------------
For each element group definition there is a comment specifying the color used
in Godot editor's default theme to highlight that particulare element. This is
to help keeping track of the various elements during tests, and to create a
stylesheet mimicking the original look and feel of Godot's editor.
Color here are given as hex values representing them as they appear on screen
(unlike Godot theme files, which contain alpha values).
Color names were calculated using NTC (Name That Color) tool:
-- https://github.com/tajmone/name-that-color
------------------------------------------------------------------------------
]]
Description="GDScript"
IgnoreCase=false
Keywords={
{ Id=1, -- Keywords #FFFFB3 -- "Portafino" Yellow
List={
-- ========== KEYOWRDS ==========
-- Keywords list taken from 'gd_script.cpp':
-- operators
"and",
"in",
"not",
"or",
-- types and values
"bool",
"false",
"float",
"int",
"null",
"PI",
"self",
"true",
-- functions
"assert",
"breakpoint",
"class",
"extends",
"func",
"preload",
"setget",
"signal",
"tool",
"yield",
-- var
"const",
"enum",
"export",
"onready",
"static",
"var",
-- control flow
"break",
"continue",
"elif",
"else",
"for",
"if",
"master",
"match",
"pass",
"remote",
"return",
"slave",
"sync",
"while",
-- ========== FUNCTIONS ==========
-- Functions list taken from 'gd_functions.cpp':
"abs",
"acos",
"asin",
"atan",
"atan2",
"bytes2var",
"ceil",
"char",
"clamp",
"Color8",
"ColorN",
"convert",
"cos",
"cosh",
"db2linear",
"decimals",
"dectime",
"deg2rad",
"dict2inst",
"ease",
"exp",
"floor",
"fmod",
"fposmod",
"funcref",
"hash",
"inst2dict",
"instance_from_id",
"is_inf",
"is_nan",
"lerp",
"linear2db",
"load",
"log",
"max",
"min",
"nearest_po2",
"parse_json",
"pow",
"print",
"print_stack",
"printerr",
"printraw",
"prints",
"printt",
"rad2deg",
"rand_range",
"rand_seed",
"randf",
"randi",
"randomize",
"range",
"round",
"seed",
"sign",
"sin",
"sinh",
"sqrt",
"stepify",
"str",
"str2var",
"tan",
"tanh",
"to_json",
"type_exists",
"typeof",
"validate_json",
"var2bytes",
"var2str",
"weakref",
},
},
{ Id=2, -- Core Types #A3FFD4 -- "Aquamarine" Green
List={
-- ========== CORE TYPES (aka Base Types) ==========
-- TAKEN FROM 'script_text_editor.cpp':
"AABB",
"Color",
"Image",
"InputEvent",
"Matrix3",
"NodePath",
"Plane",
"Quat",
"Rect2",
"Transform",
"Vector2",
"Vector3",
},
},
{ Id=3, -- Functions #66A1CD -- "Danube" Blue
Regex=[[ ([a-zA-Z_][a-zA-Z_0-9]*)(?:(\s*)?\() ]],
Group=1
},
{ Id=4, -- Member vars #E64D59 -- "Mandy" Red
Regex=[[ (?<=\.)([a-zA-Z_][a-zA-Z_0-9]*) ]],
Group=1
},
}
Comments={ -- #973D1A -- "Cumin" Red
{ Block=false,
Nested=false,
Delimiter = { [[#]] }
}
}
Strings={ -- #EF6EBD -- "Hot Pink"
Delimiter=[["""|'''|"|']],
Escape=[=[\\[abtnvfr'"\\/"]|\\u[[:xdigit:]]{4}]=],
Interpolation=[[ (?<!%)%[0-9-+*.]{0,}[scdoxXf] ]]
--[[================================= DEV NOTES ==================================
ESCAPE SEQUENCES were modeled according to Godot source code:
"/modules/gdscript/gd_tokenizer.cpp" (lines: 604-)
The following escape sequences are matched by 'Escape' RegEx:
\a \b \t \n \v \f \r \' \" \\ \/
\uhhhh (universal character names): "\u" followed by four hex digits (h)
representing a Unicode code point.
NOTE: Hexadecimal (\xhh...) and Octal (\nnn) escape sequences are unsupported
as they appear to be depreacted in GDScript ("gd_tokenizer.cpp":619).
]]
}
Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\.|\:|\&|\^|\||<|>|\!|\=|\/|\*|\%|\+|\-|\@]]
-- Digits :: not defined. Highlight defaults seem to work alright enough.
--[[==============================================================================
CHANGELOG
==============================================================================
v1.0 (2017/02/16)
-- First release.
-- Godot Engine 2.1.2.
]]
|