summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_compiler.cpp
AgeCommit message (Collapse)Author
2022-09-24Remove redundant "if" condition in GDScriptCompiler::_parse_function()Andy Maloney
Looking at the original PR, I believe this is the original intent, but it now means that previously dead code is now executed.
2022-07-26[Net] Modularize multiplayer, expose MultiplayerAPI to extensions.Fabio Alessandrelli
- RPC configurations are now dictionaries. - Script.get_rpc_methods renamed to Script.get_rpc_config. - Node.rpc[_id] and Callable.rpc now return an Error. - Refactor MultiplayerAPI to allow extension. - New MultiplayerAPI.rpc method with Array argument (for scripts). - Move the default MultiplayerAPI implementation to a module.
2022-07-18Check for parameters shadowing class memberscdemirer
2022-07-05Add grouping annotations for class properties in GDScriptYuri Sizov
2022-06-28Fix set chain bug with jump_if_sharedcdemirer
2022-06-27Merge pull request #62462 from vnen/gdscript-setter-chainingRémi Verschelde
GDScript: Fix setter being called in chains for shared types
2022-06-27GDScript: Fix setter being called in chains for shared typesGeorge Marques
When a type is shared (i.e. passed by reference) it doesn't need to be called in a setter chain (e.g. `a.b.c = 0`) since it will be updated in place. This commit adds an instruction that jumps when the value is shared so it can be used to skip those cases and avoid redundant calls of setters. It also solves issues when assigning to sub-properties of read-only properties.
2022-06-24GDScript: Use implicit method for @onready variablesGeorge Marques
Initialize them with the implicit method so they're not related to the overriding of the `_ready` method of the script but instead are always set.
2022-06-24GDScript: Don't add implicit constructor to the list of functionsGeorge Marques
So it's not shown on docs or when listing the methods. This also avoids being able to call it using the `call()` function.
2022-06-17Make enum/constant binds 64-bit.bruvzg
2022-06-14Merge pull request #57151 from cdemirer/fix-match-array-dict-pattern-logic-errorGeorge Marques
Fix logic errors in match-statement Array & Dictionary patterns
2022-05-27GDScript: Support `%` in shorthand for `get_node`George Marques
The `%` is used in scene unique nodes. Now `%` can also be used instead of `$` for the shorthand, besides being allowed generally anywhere in the path as the prefix for a node name.
2022-05-18Fix crash when extending inner class in GDScriptYuri Rubinsky
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-12Add a new HashMap implementationreduz
Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
2022-05-03Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio
These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
2022-04-24GDScript: Allow using self in lambdasGeorge Marques
2022-04-08GDScript: Fix method call on singletonsGeorge Marques
2022-04-06GDScript: Add support for static method calls in native typesGeorge Marques
2022-03-04Merge pull request #56830 from strank/parent-signalsRémi Verschelde
2022-03-04Merge pull request #58320 from mphe/fix_object_typed_arraysRémi Verschelde
2022-03-02Fix logic errors in match-statement Array & Dictionary Patternscdemirer
2022-02-19Fix typed arrays for Object based typesMarvin Ewald
Fixes https://github.com/godotengine/godot/issues/53771.
2022-02-17Fix using typed arrays based on script classesSaracenOne
2022-02-11Fix "Identifier not found" compiler error when accessing inherited signals ↵strank
or functions as callables.
2022-02-03GDScript: Treat enum values as int and enum types as dictionaryGeorge Marques
Since enums resolve to a dictionary at runtime, calling dictionary methods on an enum type is a valid use case. This ensures this is true by adding test cases. This also makes enum values be treated as ints when used in operations.
2022-02-03GDScript: Consolidate behavior for assigning enum typesGeorge Marques
This makes sure that assigning values to enum-typed variables are consistent. Same enum is always valid, different enum is always invalid (without casting) and assigning `int` creates a warning if there is no casting. There are new test cases to ensure this behavior doesn't break in the future.
2022-01-13GDScript: Fix parsing default parameter values from function callsstrank
2022-01-11Assign member type when parsing setters to preventSaracenOne
'Compiler bug: unresolved assign' errors
2022-01-10Merge pull request #56260 from ↵Rémi Verschelde
cdemirer/fix-type-mutation-upon-assignment-with-operation
2022-01-10Merge pull request #56287 from ↵Rémi Verschelde
cdemirer/fix-member-property-only-getter-cant-be-set
2022-01-10Merge pull request #56288 from ↵Rémi Verschelde
cdemirer/fix-member-property-getter-dont-update-subscript-chain-root
2022-01-10Fix leak when function returning self typeGer Hean
Leak is caused by cyclic reference
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-28Fix member properties with getters don't update as subscript chain rootcdemirer
2021-12-28Fix member properties with only getters can't be setcdemirer
2021-12-27Fix type mutation upon compound assignmentcdemirer
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-10-14GDScript: Make sure calls don't use return when not neededGeorge Marques
2021-10-08GDScript: Report property type errorsZuBsPaCe
Inline getters & setters are now FunctionNodes. Their names are set in the parser, not in the compiler. GDScript-Analyzer will now run through getter and setter. Also report wrong type or signature errors regarding getset properties. Added GDScript tests for getters and setters. #53102
2021-10-04GDScript fix wrong base class assignmentBrian Semrau
2021-10-04GDScript: Fix member assignment with operationGeorge Marques
It was wrongly updating the assigned value with the result of the operation.
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-29GDScript: Fix assignment with operation for propertiesGeorge Marques
2021-09-15Merge pull request #49765 from ↵George Marques
Blackiris/fix-assignment-with-operator-on-type-member Fix assignment with operator on type member
2021-09-15GDScript: Allow string keys on Lua-style dictionariesGeorge Marques
Which is useful when the key isn't a valid identifier, such as keys with spaces or numeric keys.
2021-09-13Merge pull request #52323 from vnen/gdscript-singleton-interdependence-fixRémi Verschelde
Fix loading of interdependent autoloads
2021-09-07[Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli
Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".
2021-09-02Check for GDScript member and class naming conflicts in a variety of conditions.SaracenOne
2021-09-01GDScript: Fix loading of interdependent autoloadsGeorge Marques
Move the autoload resolution to runtime by loading it into the stack with an extra instruction. This allows an autoload to use another autoload singleton independent of load order.