-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve a bit gdscript syntax #3198
base: master
Are you sure you want to change the base?
Conversation
dustdfg
commented
Mar 20, 2024
- Add some keywords
- Add annotations support
runtime/syntax/gdscript.yaml
Outdated
|
||
# Operators | ||
- statement: "[.:;,+*|=!\\%@]|<|>|/|-|&" | ||
|
||
# Annotations | ||
- special: "^@\\b(export|export_category|export_color_no_alpha|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_flags_avoidance|export_global_dir|export_global_file|export_group|export_multiline|export_node_path|export_placeholder|export_range|export_subgroup|icon|onready|rpc|tool|warning_ignore)\\b+" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing with Godot docs the @static_unload
annotation seems to be missing. The first \\b
and the +
at the end don't do anything useful.
- special: "^@\\b(export|export_category|export_color_no_alpha|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_flags_avoidance|export_global_dir|export_global_file|export_group|export_multiline|export_node_path|export_placeholder|export_range|export_subgroup|icon|onready|rpc|tool|warning_ignore)\\b+" | |
- special: "^@(export|export_category|export_color_no_alpha|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_flags_avoidance|export_global_dir|export_global_file|export_group|export_multiline|export_node_path|export_placeholder|export_range|export_subgroup|icon|onready|rpc|static_unload|tool|warning_ignore)\\b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+
- typo@static_unload
- thanks\\b
It is used everywhere. Something starts from\\b
and ends from it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\b It is used everywhere. Something starts from \b and ends from it
\b
means word boundary (for example \bas\b
would match both "as"
and "@as"
but not "gas"
). In this case it is not necessary because there is always a word boundary (the previous character is a non-word character @
and the following character is a letter).
* Add some keywords * Add annotations support Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com> Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>
7d7fe32
to
370ae2f
Compare