2017-03-21 21:55:22 +03:00
|
|
|
filetype: gdscript
|
|
|
|
|
2017-03-21 22:07:39 +03:00
|
|
|
detect:
|
2017-03-21 21:55:22 +03:00
|
|
|
filename: "\\.gd$"
|
|
|
|
|
|
|
|
rules:
|
2017-03-21 22:07:39 +03:00
|
|
|
# built-in objects
|
2017-03-21 21:55:22 +03:00
|
|
|
- constant: "\\b(null|self|true|false)\\b"
|
2017-03-21 22:07:39 +03:00
|
|
|
# built-in attributes
|
|
|
|
# color constant "\\b()\\b"
|
|
|
|
# built-in functions
|
2017-03-21 21:55:22 +03:00
|
|
|
- identifier: "\\b(abs|acos|asin|atan|atan2|ceil|clamp|convert|cos|cosh|db2linear|decimals|deg2rad|ease|exp|float|floor|fmod|fposmod|hash|int|isinf|isnan|lerp|linear2db|load|log|max|min|nearest_po2|pow|preload|print|printerr|printraw|prints|printt|rad2deg|rand_range|rand_seed|randomize|randi|randf|range|round|seed|sin|slerp|sqrt|str|str2var|tan|typeof|var2str|weakref)\\b"
|
2017-03-21 22:07:39 +03:00
|
|
|
# special method names
|
2017-03-21 21:55:22 +03:00
|
|
|
- identifier: "\\b(AnimationPlayer|AnimationTreePlayer|Button|Control|HTTPClient|HTTPRequest|Input|InputEvent|MainLoop|Node|Node2D|SceneTree|Spatial|SteamPeer|PacketPeer|PacketPeerUDP|Timer|Tween)\\b"
|
2017-03-21 22:07:39 +03:00
|
|
|
# types
|
2017-03-21 21:55:22 +03:00
|
|
|
- type: "\\b(Vector2|Vector3)\\b"
|
2017-03-21 22:07:39 +03:00
|
|
|
# definitions
|
|
|
|
- identifier: "func [a-zA-Z_0-9]+"
|
|
|
|
# keywords
|
|
|
|
- statement: "\\b(and|as|assert|break|breakpoint|class|const|continue|elif|else|export|extends|for|func|if|in|map|not|onready|or|pass|return|signal|var|while|yield)\\b"
|
|
|
|
|
|
|
|
# decorators
|
2017-03-21 21:55:22 +03:00
|
|
|
- special: "@.*[(]"
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
# operators
|
2017-03-21 21:55:22 +03:00
|
|
|
- statement: "[.:;,+*|=!\\%@]|<|>|/|-|&"
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
# parentheses
|
2017-03-21 21:55:22 +03:00
|
|
|
- statement: "[(){}]|\\[|\\]"
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
# numbers
|
2017-03-21 21:55:22 +03:00
|
|
|
- constant: "\\b[0-9]+\\b"
|
|
|
|
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
- constant.string:
|
|
|
|
start: "\""
|
2017-03-23 02:03:06 +03:00
|
|
|
end: "(?<!\\\\)\""
|
2017-03-21 22:07:39 +03:00
|
|
|
rules:
|
|
|
|
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
|
|
|
|
|
|
|
- constant.string:
|
|
|
|
start: "'"
|
2017-03-23 02:03:06 +03:00
|
|
|
end: "(?<!\\\\)'"
|
2017-03-21 22:07:39 +03:00
|
|
|
rules:
|
|
|
|
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
|
|
|
|
|
|
|
- constant.string:
|
|
|
|
start: "`"
|
|
|
|
end: "`"
|
|
|
|
rules: []
|
|
|
|
|
|
|
|
- comment:
|
|
|
|
start: "#"
|
|
|
|
end: "$"
|
|
|
|
rules:
|
|
|
|
- todo: "(TODO|XXX|FIXME):?"
|
|
|
|
|
2017-03-21 21:55:22 +03:00
|
|
|
- comment:
|
2017-03-21 22:07:39 +03:00
|
|
|
start: "\"\"\""
|
2017-03-21 21:55:22 +03:00
|
|
|
end: "\"\"\""
|
2017-03-21 22:07:39 +03:00
|
|
|
rules:
|
|
|
|
- todo: "(TODO|XXX|FIXME):?"
|
2017-03-21 21:55:22 +03:00
|
|
|
|
|
|
|
- comment:
|
2017-03-21 22:07:39 +03:00
|
|
|
start: "'''"
|
2017-03-21 21:55:22 +03:00
|
|
|
end: "'''"
|
2017-03-21 22:07:39 +03:00
|
|
|
rules:
|
|
|
|
- todo: "(TODO|XXX|FIXME):?"
|
2017-03-23 02:03:06 +03:00
|
|
|
|