Commit Graph

105 Commits

Author SHA1 Message Date
Rémi Verschelde 745f8e112f Revert "Add UID support to GDScript files"
This reverts commit c7f68a27ec.

We still think GDScript files need UIDs to allow safe refactoring,
but we're still debating what form those should take exactly.

So far there seems to be agreement that it shouldn't be done via an
annotation as implemented here, so we're reverting this one for now,
to revisit the feature in a future PR.
2024-01-29 21:00:26 +01:00
kobewi c7f68a27ec Add UID support to GDScript files 2024-01-17 22:30:56 +01:00
Danil Alexeev 668ba2d1a5 GDScript: Allow empty parentheses for property getter declaration 2023-10-11 09:54:17 +03:00
Danil Alexeev 9e2273abc7 GDScript: Add error when exporting node in non [Node]-derived classes 2023-10-05 13:50:26 +03:00
Yuri Sizov 813cd1dfc8 Merge pull request #80085 from vnen/gdscript-pattern-guards
GDScript: Implement pattern guards for match statement
2023-09-28 20:03:57 +02:00
George Marques 54a1414500 GDScript: Implement pattern guards for match statement
Within a match statement, it is now possible to add guards in each
branch:

	var a = 0
	match a:
		0 when false: print("does not run")
		0 when true: print("but this does")

This allows more complex logic for deciding which branch to take.
2023-09-27 11:25:25 -03:00
Danil Alexeev e8696f9961 GDScript: Improve call analysis
* Add missing `UNSAFE_CALL_ARGUMENT` warning.
* Fix `Object` constructor.
* Display an error for non-existent static methods.
2023-09-21 13:36:39 +03:00
Danil Alexeev 2964c7d51c GDScript: Add raw string literals (r-strings) 2023-09-11 18:34:33 +03:00
Danil Alexeev 00ad9e484e GDScript: Allow mixed indentation on blank lines 2023-08-17 10:54:43 +03:00
Rémi Verschelde 8a06ec979e Change explicit 'Godot 4.0' references to 'Godot 4'
Fixes #79276.
2023-07-10 13:08:11 +02:00
今井きなみ bf04c55175 Fix lambda parsing continuing on subsequent lines #73273 2023-06-21 12:56:57 +02:00
Rémi Verschelde 1ce2425c0e Merge pull request #73363 from dalexeev/gds-fix-min-int-not-representable
GDScript: Fix `MIN_INT` not representable as numeric literal
2023-06-18 16:27:16 +02:00
Danil Alexeev fba8cbe6db GDScript: Fix repeated _ are allowed after decimal point 2023-06-14 21:47:12 +03:00
Danil Alexeev 13310f3557 GDScript: Reorganize and unify warnings 2023-04-28 18:25:11 +03:00
George Marques 0ba6048ad3 Add support for static variables in GDScript
Which allows editable data associated with a particular class instead of
the instance. Scripts with static variables are kept in memory
indefinitely unless the `@static_unload` annotation is used or the
`static_unload()` method is called on the GDScript.

If the custom function `_static_init()` exists it will be called when
the class is loaded, after the static variables are set.
2023-04-27 09:51:44 -03:00
Danil Alexeev dbc3c82043 GDScript: Add some checks for @tool and @icon 2023-04-20 07:44:10 +03:00
Yuri Sizov 6596a6c1b5 Merge pull request #72979 from dalexeev/gds-annotation-parsing
GDScript: Fix and improve annotation parsing
2023-04-17 17:14:58 +02:00
ajreckof ab9f60dd1a fix access to identifiers that are reserved keywords 2023-04-14 20:37:24 +02:00
Danil Alexeev 5038a336be GDScript: Fix and improve annotation parsing 2023-04-14 21:28:46 +03:00
Danil Alexeev ea5fd3d732 Fix GDScript code style regarding colon 2023-03-05 17:03:20 +03:00
Rémi Verschelde 491ded1898 Minor typo and docs URL fixes 2023-02-28 13:38:01 +01:00
Dmitrii Maganov b0b1eaeb6d GDScript: Fix parsing unexpected break/continue in lambda 2023-02-23 10:49:06 +02:00
Danil Alexeev d15511725a GDScript: Fix MIN_INT not representable as numeric literal 2023-02-15 17:41:46 +03:00
Rémi Verschelde dc7f08b556 Merge pull request #72971 from vnen/gdscript-multiline-comment
GDScript: Allow strings as multiline comments
2023-02-09 16:19:03 +01:00
George Marques 03ea77407c GDScript: Be more lenient with identifiers
- Allow identifiers similar to keywords if they are in ASCII range.
- Allow constants to be treated as regular identifiers.
- Allow keywords that can be used as identifiers in expressions.
2023-02-09 11:19:05 -03:00