"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/gdscript.lang" (12 May 2020, 6049 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "gdscript.lang": 3.53_vs_3.54.

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