X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fgdscript.yaml;h=0498ab548fe7243fee39b7818e7f9ae2fbdcfedf;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=8a7a6c04ed31259c3c089f9dbd1ad15d23f5c060;hpb=87f54be13a8f191ac9d4e7b7897c5f04da61e29a;p=micro.git diff --git a/runtime/syntax/gdscript.yaml b/runtime/syntax/gdscript.yaml index 8a7a6c04..0498ab54 100644 --- a/runtime/syntax/gdscript.yaml +++ b/runtime/syntax/gdscript.yaml @@ -4,66 +4,58 @@ detect: filename: "\\.gd$" rules: - # built-in objects - - constant: "\\b(null|self|true|false)\\b" - # built-in attributes - # color constant "\\b()\\b" - # built-in functions + # Built-in constants + - constant: "\\b(INF|NAN|PI|TAU)\\b" + - constant.bool: "\\b(null|true|false)\\b" + # Built-in functions - 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" - # special method names - - identifier: "\\b(AnimationPlayer|AnimationTreePlayer|Button|Control|HTTPClient|HTTPRequest|Input|InputEvent|MainLoop|Node|Node2D|SceneTree|Spatial|SteamPeer|PacketPeer|PacketPeerUDP|Timer|Tween)\\b" - # types - - type: "\\b(Vector2|Vector3)\\b" - # 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 - - special: "@.*[(]" - - # operators + # Built-in node names + - identifier: "\\b(AnimationPlayer|AnimationTreePlayer|Button|Control|Engine|HTTPClient|HTTPRequest|Input|InputEvent|MainLoop|Node|Node2D|OS|SceneTree|Spatial|StreamPeer|PacketPeer|PacketPeerUDP|Timer|Tween)\\b" + # Types + - type: "\\b(AABB|Array|Basis|Color|Dictionary|NodePath|Object|Plane|PoolByteArray|PoolColorArray|PoolIntArray|PoolRealArray|PoolVector2Array|PoolVector3Array|Quat|Rect2|RID|String|Transform|Transform2D|Vector2|Vector3)\\b" + # Definitions + - identifier: "func [a-zA-Z_0-9]+" + # Keywords + - statement: "\\b(and|as|assert|break|breakpoint|class|const|continue|elif|else|enum|export|extends|for|func|if|in|is|map|master|mastersync|match|not|onready|or|pass|remote|remotesync|return|self|setget|slave|slavesync|signal|sync|tool|var|while|yield)\\b" + + # Operators - statement: "[.:;,+*|=!\\%@]|<|>|/|-|&" - # parentheses + # Parentheses - statement: "[(){}]|\\[|\\]" - # numbers + # Numbers - constant: "\\b[0-9]+\\b" - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'" + - comment: + start: "\"\"\"" + end: "\"\"\"" + rules: + - todo: "(TODO|XXX|FIXME):?" + + - comment: + start: "'''" + end: "'''" + rules: + - todo: "(TODO|XXX|FIXME):?" + - constant.string: start: "\"" - end: "(?