@@ -4,73 +4,65 @@ Author: Khairul Hidayat <me@khairul.my.id>, Nelson Sylvest*r Fritsch <info@nelso
4
4
Description: Programming language for Godot Engine
5
5
*/
6
6
7
- var module = module ? module : { } ; // shim for browser use
8
-
9
- function hljsDefineGDScript ( hljs ) {
7
+ function GDScript ( hljs ) {
10
8
var KEYWORDS = {
11
9
keyword :
12
- ' and in not or self void as assert breakpoint class class_name ' +
13
- ' extends is func setget signal tool yield const enum export ' +
14
- ' onready static var break continue if elif else for pass return ' +
15
- ' match while remote sync master puppet remotesync mastersync ' +
16
- ' puppetsync' ,
10
+ " and in not or self void as assert breakpoint class class_name " +
11
+ " extends is func setget signal tool yield const enum export " +
12
+ " onready static var break continue if elif else for pass return " +
13
+ " match while remote sync master puppet remotesync mastersync " +
14
+ " puppetsync" ,
17
15
18
16
built_in :
19
- ' Color8 ColorN abs acos asin atan atan2 bytes2var ' +
20
- ' cartesian2polar ceil char clamp convert cos cosh db2linear ' +
21
- ' decimals dectime deg2rad dict2inst ease exp floor fmod fposmod ' +
22
- ' funcref get_stack hash inst2dict instance_from_id inverse_lerp ' +
23
- ' is_equal_approx is_inf is_instance_valid is_nan is_zero_approx ' +
24
- ' len lerp lerp_angle linear2db load log max min move_toward ' +
25
- ' nearest_po2 ord parse_json polar2cartesian posmod pow preload ' +
26
- ' print_stack push_error push_warning rad2deg rand_range ' +
27
- ' rand_seed randf randi randomize range_lerp round seed sign sin ' +
28
- ' sinh smoothstep sqrt step_decimals stepify str str2var tan tanh ' +
29
- ' to_json type_exists typeof validate_json var2bytes var2str ' +
30
- ' weakref wrapf wrapi bool int float String NodePath ' +
31
- ' Vector2 Rect2 Transform2D Vector3 Rect3 Plane ' +
32
- ' Quat Basis Transform Color RID Object NodePath ' +
33
- ' Dictionary Array PoolByteArray PoolIntArray ' +
34
- ' PoolRealArray PoolStringArray PoolVector2Array ' +
35
- ' PoolVector3Array PoolColorArray' ,
17
+ " Color8 ColorN abs acos asin atan atan2 bytes2var " +
18
+ " cartesian2polar ceil char clamp convert cos cosh db2linear " +
19
+ " decimals dectime deg2rad dict2inst ease exp floor fmod fposmod " +
20
+ " funcref get_stack hash inst2dict instance_from_id inverse_lerp " +
21
+ " is_equal_approx is_inf is_instance_valid is_nan is_zero_approx " +
22
+ " len lerp lerp_angle linear2db load log max min move_toward " +
23
+ " nearest_po2 ord parse_json polar2cartesian posmod pow preload " +
24
+ " print_stack push_error push_warning rad2deg rand_range " +
25
+ " rand_seed randf randi randomize range_lerp round seed sign sin " +
26
+ " sinh smoothstep sqrt step_decimals stepify str str2var tan tanh " +
27
+ " to_json type_exists typeof validate_json var2bytes var2str " +
28
+ " weakref wrapf wrapi bool int float String NodePath " +
29
+ " Vector2 Rect2 Transform2D Vector3 Rect3 Plane " +
30
+ " Quat Basis Transform Color RID Object NodePath " +
31
+ " Dictionary Array PoolByteArray PoolIntArray " +
32
+ " PoolRealArray PoolStringArray PoolVector2Array " +
33
+ " PoolVector3Array PoolColorArray" ,
36
34
37
- literal :
38
- 'true false null'
35
+ literal : "true false null"
39
36
} ;
40
37
41
38
return {
42
- aliases : [ ' godot' , ' gdscript' ] ,
39
+ aliases : [ " godot" , " gdscript" ] ,
43
40
keywords : KEYWORDS ,
44
41
contains : [
45
42
hljs . NUMBER_MODE ,
46
43
hljs . HASH_COMMENT_MODE ,
47
44
{
48
- className : 'comment' ,
49
- begin : / " " " / , end : / " " " /
45
+ className : "comment" ,
46
+ begin : / " " " / ,
47
+ end : / " " " /
50
48
} ,
51
49
hljs . QUOTE_STRING_MODE ,
52
50
{
53
51
variants : [
54
52
{
55
- className : ' function' ,
56
- beginKeywords : ' func'
53
+ className : " function" ,
54
+ beginKeywords : " func"
57
55
} ,
58
56
{
59
- className : ' class' ,
60
- beginKeywords : ' class'
57
+ className : " class" ,
58
+ beginKeywords : " class"
61
59
}
62
60
] ,
63
61
end : / : / ,
64
- contains : [
65
- hljs . UNDERSCORE_TITLE_MODE
66
- ]
62
+ contains : [ hljs . UNDERSCORE_TITLE_MODE ]
67
63
}
68
64
]
69
65
} ;
70
66
}
71
67
72
- module . exports = function ( hljs ) {
73
- hljs . registerLanguage ( 'gdscript' , hljsDefineGDScript ) ;
74
- } ;
75
-
76
- module . exports . definer = hljsDefineGDScript ;
68
+ module . exports = GDScript ;
0 commit comments