|
3 | 3 | 'fileTypes': [
|
4 | 4 | 'gd'
|
5 | 5 | ]
|
6 |
| -'firstLineMatch': '^#!/.*\\bgdscript\\b' |
| 6 | +#'firstLineMatch': '^#!/.*\\bgdscript\\b' |
7 | 7 | 'patterns': [
|
8 | 8 | {
|
9 | 9 | 'begin': '(^[ \\t]+)?(?=#)'
|
|
82 | 82 | 'name': 'keyword.control.import.from.gdscript'
|
83 | 83 | 'match': '\\b(?:(import)|(from))\\b'
|
84 | 84 | }
|
| 85 | + { |
| 86 | + 'captures': |
| 87 | + '1': |
| 88 | + 'name': 'keyword.control.import.gdscript' |
| 89 | + '2': |
| 90 | + 'name': 'keyword.control.import.from.gdscript' |
| 91 | + 'match': '\\b(?:(extends)|(from))\\b' |
| 92 | + } |
85 | 93 | {
|
86 | 94 | 'comment': 'keywords that delimit flow conditionals'
|
87 | 95 | 'name': 'keyword.control.conditional.gdscript'
|
|
112 | 120 | '1':
|
113 | 121 | 'name': 'keyword.other.gdscript'
|
114 | 122 | 'comment': 'keywords that haven\'t fit into other groups (yet).'
|
115 |
| - 'match': '\\b(as|assert|del|exec|print)\\b' |
| 123 | + 'match': '\\b(as|assert|del|exec|print|var)\\b' |
116 | 124 | }
|
117 | 125 | {
|
118 | 126 | 'match': '<>'
|
|
299 | 307 | }
|
300 | 308 | ]
|
301 | 309 | }
|
| 310 | + { |
| 311 | + 'begin': '^\\s*(func)\\s+(?=[A-Za-z_][A-Za-z0-9_]*)' |
| 312 | + 'beginCaptures': |
| 313 | + '1': |
| 314 | + 'name': 'storage.type.function.gdscript' |
| 315 | + 'end': '(\\()|\\s*($\\n?|#.*$\\n?)' |
| 316 | + 'endCaptures': |
| 317 | + '1': |
| 318 | + 'name': 'punctuation.definition.parameters.begin.gdscript' |
| 319 | + '2': |
| 320 | + 'name': 'invalid.illegal.missing-parameters.gdscript' |
| 321 | + 'name': 'meta.function.gdscript' |
| 322 | + 'patterns': [ |
| 323 | + { |
| 324 | + 'begin': '(?=[A-Za-z_][A-Za-z0-9_]*)' |
| 325 | + 'contentName': 'entity.name.function.gdscript' |
| 326 | + 'end': '(?![A-Za-z0-9_])' |
| 327 | + 'patterns': [ |
| 328 | + { |
| 329 | + 'include': '#entity_name_function' |
| 330 | + } |
| 331 | + ] |
| 332 | + } |
| 333 | + ] |
| 334 | + } |
302 | 335 | {
|
303 | 336 | 'begin': '(lambda)(?=\\s+)'
|
304 | 337 | 'beginCaptures':
|
|
502 | 535 | 'captures':
|
503 | 536 | '1':
|
504 | 537 | 'name': 'storage.type.function.gdscript'
|
505 |
| - 'match': '\\b(def|lambda)\\b' |
| 538 | + 'match': '\\b(def|lambda|func)\\b' |
506 | 539 | }
|
507 | 540 | {
|
508 | 541 | 'captures':
|
|
641 | 674 | 'match': '(?x)\\b(\n\t\t\t\t(\n\t\t\t\t\tArithmetic|Assertion|Attribute|BlockingIO|BrokenPipe|Buffer|ChildProcess|\n\t\t\t\t\tConnection(Aborted|Refused|Reset)?|EOF|Environment|FileExists|\n\t\t\t\t\tFileNotFound|FloatingPoint|Interrupted|IO|IsADirectoryError|\n\t\t\t\t\tImport|Indentation|Index|Key|Lookup|Memory|Name|NotADirectory|\n\t\t\t\t\tNotImplemented|OS|Overflow|Permission|ProcessLookup|Reference|\n\t\t\t\t\tRuntime|Standard|Syntax|System|Tab|Timeout|Type|UnboundLocal|\n\t\t\t\t\tUnicode(Encode|Decode|Translate)?|Value|VMS|Windows|ZeroDivision\n\t\t\t\t)Error|\n\t\t\t\t((Pending)?Deprecation|Runtime|Syntax|User|Future|Import|Unicode|Bytes)?Warning|\n\t\t\t\t(Base)?Exception|\n\t\t\t\tSystemExit|StopIteration|NotImplemented|KeyboardInterrupt|GeneratorExit\n\t\t\t)\\b'
|
642 | 675 | 'name': 'support.type.exception.gdscript'
|
643 | 676 | 'builtin_functions':
|
644 |
| - 'match': '(?x)\\b(\n\t\t\t\t__import__|all|abs|any|apply|ascii|bin|callable|chr|classmethod|cmp|coerce|\n\t\t\t\tcompile|delattr|dir|divmod|enumerate|eval|execfile|filter|format|getattr|\n\t\t\t\tglobals|hasattr|hash|help|hex|id|input|intern|isinstance|issubclass|iter|\n\t\t\t\tlen|locals|map|max|min|next|oct|open|ord|pow|print|property|range|\n\t\t\t\traw_input|reduce|reload|repr|reversed|round|setattr|sorted|staticmethod|\n\t\t\t\tsum|super|type|unichr|vars|zip\n\t\t\t)\\b' |
| 677 | + 'match': '(?x)\\b(\n\t\t\t\t__import__|extends|all|abs|any|apply|ascii|bin|callable|chr|classmethod|cmp|coerce|\n\t\t\t\tcompile|delattr|dir|divmod|enumerate|eval|execfile|filter|format|getattr|\n\t\t\t\tglobals|hasattr|hash|help|hex|id|input|intern|isinstance|issubclass|iter|\n\t\t\t\tlen|locals|map|max|min|next|oct|open|ord|pow|print|property|range|\n\t\t\t\traw_input|reduce|reload|repr|reversed|round|setattr|sorted|staticmethod|\n\t\t\t\tsum|super|type|unichr|vars|get_tree|get_node|get_root|get_child|get_child_count|queue_free|load|instance|add_child|play|get_item_rect|get_viewport_rect|is_action_pressed|get_joy_axis|get_pos|get_mouse_pos|set_pos|get_children|is_visible|get_texture|get_size|hide|show|Node|Node2D|Rect2|Input|Vector2|zip\n\t\t\t)\\b' |
645 | 678 | 'name': 'support.function.builtin.gdscript'
|
646 | 679 | 'builtin_types':
|
647 | 680 | 'match': '(?x)\\b(\n\t\t\t\tbasestring|bool|buffer|bytearray|bytes|complex|dict|float|frozenset|int|\n\t\t\t\tlist|long|memoryview|object|range|set|slice|str|tuple|unicode|xrange\n\t\t\t)\\b'
|
|
808 | 841 | 'generic_names':
|
809 | 842 | 'match': '[A-Za-z_][A-Za-z0-9_]*'
|
810 | 843 | 'illegal_names':
|
811 |
| - 'match': '\\b(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\\b' |
| 844 | + 'match': '\\b(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|extends|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\\b' |
812 | 845 | 'name': 'invalid.illegal.name.gdscript'
|
813 | 846 | 'keyword_arguments':
|
814 | 847 | 'begin': '\\b([a-zA-Z_][a-zA-Z_0-9]*)\\s*(=)(?!=)'
|
|
0 commit comments