summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | GDScript: Removed spurious UNASSIGNED_VARIABLE warning for localsZuBsPaCe2021-09-101-2/+6
| | | | | | | | | | | | | | | | | | Variable->assignment needs to be incremented when assigned a value. Also fixed and improved unit test 'variable_declaration.gd'. Fixes #52551
* | | Merge pull request #52063 from KoBeWi/double_comma_of_doomGeorge Marques2021-09-101-2/+4
|\ \ \ | | | | | | | | Fix crash with consecutive commas in Dictionary
| * | | Fix crash with consecutive commas in Dictionarykobewi2021-09-101-2/+4
| | | |
* | | | Merge pull request #51593 from KoBeWi/ifGeorge Marques2021-09-101-1/+3
|\ \ \ \ | |/ / / |/| | | Prevent crash when awaiting in a getter/setter
| * | | Prevent crash when awaiting in a getter/setterkobewi2021-08-131-1/+3
| | | |
* | | | Merge pull request #52081 from ThreeRhinosInAnElephantCostume/fixmatchfreezeGeorge Marques2021-09-101-43/+42
|\ \ \ \ | | | | | | | | | | Fix gdscript pattern matching expressions
| * | | | Added tests for expression matchingThreeRhinosInAnElephantCostume2021-09-031-1/+2
| | | | |
| * | | | Fixed pattern matching with expressionsThreeRhinosInAnElephantCostume2021-08-251-43/+41
| | |/ / | |/| |
* | | | [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-071-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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".
* | | | [GDScript] [Net] Allow mixing rpc annotation paramters.Fabio Alessandrelli2021-08-301-21/+15
| | | | | | | | | | | | | | | | | | | | | | | | The strings no longer needs to be in order. The last parameter (channel), still requires all the other parameters to be present.
* | | | [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".Fabio Alessandrelli2021-08-301-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit completely removes the RPC_MODE_MASTER ("master" keyword), and renames the RPC_MODE_PUPPET to RPC_MODE_AUTHORITY ("auth" keyword). This commit also renames the "Node.[get|set]_network_master" methods to "Node.[get|set]_network_authority". This commit also renames the RPC_MODE_REMOTE constant to RPC_MODE_ANY. RPC_MODE_MASTER in Godot 3.x meant that a given RPC would be callable by any puppet peer on the master, while RPC_MODE_PUPPET meant that it would be callable by the master on any puppet. Beside proving to be very confusing to the user (referring to where it could be called instead of who can call it) the RPC_MODE_MASTER is quite useless. It is almost the same as RPC_MODE_REMOTE (anyone can call) with the exception that the network master cannot. While this could be useful to check in some case, in such a function you would anyway need to check in code who is the caller via get_rpc_sender_id(), so adding the check there for those rare cases does not warrants a dedicated mode.
* | | | Print error message when await is not followed by signal or coroutineWilliam Deurwaarder2021-08-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When await was not followed by a signal or coroutine the GDScript parser would crash. This fix will check if await is followed by a signal or coroutine in case that isn't true (element == nullptr) then an error message is printed.
* | | | Fixed crash when parsing an empty assignment.Louis Dumont2021-08-251-0/+3
|/ / / | | | | | | | | | Resolves #51620.
* | | Merge pull request #51971 from aaronfranke/httpsMax Hilbrunner2021-08-231-1/+1
|\ \ \ | | | | | | | | Replace HTTP URLs with HTTPS for sites with HTTPS versions
| * | | Replace HTTP links with HTTPS for sites with HTTPS versionsAaron Franke2021-08-221-1/+1
| | |/ | |/|
* / | Remove redundant assignments.Anilforextra2021-08-211-1/+0
|/ / | | | | | | Use used_in_transfer instead of used_in_compute twice.
* | Remove underscore hacksMax Hilbrunner2021-08-171-37/+2
| | | | | | | | | | | | Way less cruft. :) Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
* | Reorganise text editor settingsPaulb232021-08-161-1/+1
|/
* Fix crash when parsing Dictionarykobewi2021-08-101-1/+3
|
* [Net] Default @rpc annotation should be puppet, not master.Fabio Alessandrelli2021-08-061-1/+1
|
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-5/+5
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-11/+10
|
* Use the standard C `INFINITY` and `NAN` constants directlyHugo Locurcio2021-07-211-2/+2
| | | | | | | The `Math_INF` and `Math_NAN` defines were just aliases for those constants, so we might as well use them directly. Some portions of the code were already using `INFINITY` directly.
* [Net] Single `rpc` annotation. "sync" no longer part of mode.Fabio Alessandrelli2021-07-201-16/+44
| | | | | | | | | | | | | | | | - Move the "sync" property for RPCs to RPCConfig. - Unify GDScript annotations into a single one: - `@rpc(master)` # default - `@rpc(puppet)` - `@rpc(any)` # former `@remote` - Implement three additional `@rpc` options: - The second parameter is the "sync" option (which also calls the function locally when RPCing). One of "sync", "nosync". - The third parameter is the transfer mode (reliable, unreliable, ordered). - The third parameter is the channel (unused for now).
* Fix editor suffixes and degrees conversionreduz2021-06-301-1/+0
| | | | | | | | | | | | | * Functions to convert to/from degrees are all gone. Conversion is done by the editor. * Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees. * Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m" * In general, can add suffixes for EditorSpinSlider Not covered by this PR, will have to be addressed by future ones: * Ability to switch radians/degrees in the inspector for angle properties (if actually wanted). * Animations previously made will most likely break, need to add a way to make old ones compatible. * Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes. * Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
* Adding some more missing renames for Transform3D and QuaternionBastiaan Olij2021-06-151-1/+1
|
* Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-111-1/+1
| | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* Rename Quat to QuaternionMarcel Admiraal2021-06-041-1/+1
|
* Rename Variant TRANSFORM to TRANSFORM3DAaron Franke2021-06-031-1/+1
| | | Also _transform to _transform3d
* Fix typos with codespellRémi Verschelde2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 2.0.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn GIRD leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* GDScript: Fix crash when base of an attribute is invalidGeorge Marques2021-04-281-1/+1
| | | | | | | In attribute expressions (`a.b`) it's possible that the base has an incorrect syntax and thus become a nullptr expression in the tree. This commit add the check for this case to fail gracefully instead of crashing.
* GDScript: Implement lambdas compilation and runtimeGeorge Marques2021-04-281-3/+3
|
* GDScript: Add lambdas to the type analyzerGeorge Marques2021-04-281-5/+20
| | | | | - Lambdas are always callables (no specific signature match). - Captures from the current context are evaluated.
* GDScript: Add lambda syntax parsingGeorge Marques2021-04-281-57/+182
| | | | | | | | | | | Lambda syntax is the same as a the function syntax (using the same `func` keyword) except that the name is optional and it can be embedded anywhere an expression is expected. E.g.: func _ready(): var my_lambda = func(x): print(x) my_lambda.call("hello")
* GDScript: Make sure Lua-style dicts use StringName as keysGeorge Marques2021-04-231-0/+2
|
* Fix corrupt scene when export var has setterJulien Nguyen2021-04-141-2/+1
|
* GDScript: Implement export of typed arraysGeorge Marques2021-03-301-1/+19
|
* GDScript: Allow export of enum variablesGeorge Marques2021-03-301-2/+19
| | | | Also fix the enum type in variables to be integer.
* GDScript: Show error on invalid initializer expressionGeorge Marques2021-03-301-0/+3
|
* Move GDSript annotation application after type-checkingGeorge Marques2021-03-301-23/+82
| | | | | | This ensures that annotations that rely on the datatype (such as @export) can validated it timely, allowing compound expressions instead of only literal values.
* Add typed arrays to GDScriptGeorge Marques2021-03-291-0/+16
| | | | | | | | - Use `Array[type]` for type-hints. e.g.: `var array: Array[int] = [1, 2, 3]` - Array literals are typed if their storage is typed (variable asssignment of as argument in function all). Otherwise they are untyped.
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-1/+1
|
* Implement Navigation layersGilles Roudière2021-03-101-0/+2
|
* Merge pull request #42029 from ThakeeNathees/export-type-infer-bug-fixGeorge Marques2021-03-021-2/+7
|\ | | | | GDScript export array/dictionary type infer bug fix
| * GDScript export array/dictionary type infer bug fixThakee Nathees2020-09-131-2/+7
| | | | | | | | Fix : #41980
* | Merge pull request #41897 from strank/not-in-conditional-doneRémi Verschelde2021-03-021-1/+12
|\ \ | | | | | | Add a "not in" operator to GDScript.
| * | Add a "not in" operator to GDScript.strank2020-09-211-1/+12
| | |
* | | Merge pull request #44719 from ThakeeNathees/assert-argument-bug-fixedRémi Verschelde2021-01-111-6/+3
|\ \ \ | | | | | | | | GDScript assert message parsing bug fixed
| * | | GDScript assert message parsing bug fixedThakee Nathees2020-12-271-6/+3
| | | | | | | | | | | | | | | | Fix: #43540
* | | | Merge pull request #44818 from ThakeeNathees/const-crash-fixRémi Verschelde2021-01-111-0/+2
|\ \ \ \ | | | | | | | | | | GDScript crash at incomplete const bug fix