summaryrefslogtreecommitdiff
path: root/modules/gdscript
AgeCommit message (Collapse)Author
2019-02-20GDScript: Remove unused `switch`, `case` and `do` CF keywordsRémi Verschelde
They had been reserved for future implementation, but we now have the `match` CF keyword which does the same and more. According to @reduz `do` was even added by mistake when copying from the shader language parser, it was never intended to add support for `do`... `while` loops, as the syntax would be awkward in GDScript, and the added sugar is not worth it. Fixes #25787.
2019-02-16Merge pull request #25715 from hpvb/fix-25598Rémi Verschelde
Add a maximum recusion depth to _guess_expression_type
2019-02-14Merge pull request #25866 from neikeq/issue-25121Rémi Verschelde
Fix exported property values being lost if base GDScript fails to parse
2019-02-14Fix exported property values being lost if base GDScript fails to parseIgnacio Etcheverry
2019-02-13Fix typos with codespellRémi Verschelde
Using codespell 1.14.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang doubleclick lod nd numer que te unselect EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
2019-02-12Core: Ensure classes match their header filenameRémi Verschelde
Also drop some unused files. Renamed: - `core/dvector.h` -> `pool_vector.h` - `core/io/resource_import.h` -> `resource_importer.h` - `core/sort.h` -> `sort_array.h` - `core/string_db.h` -> `string_name.h` Dropped: - `core/allocators.h` - `core/os/shell.h` - `core/variant_construct_string.cpp`
2019-02-12Merge pull request #25481 from hpvb/fix-ubsan-asan-reportsRémi Verschelde
Fix many asan and ubsan reported issues
2019-02-12Merge pull request #25550 from DualMatrix/fix-25357Rémi Verschelde
Fixed Null appearing inside export variables with type hints and no default value
2019-02-09Merge pull request #25650 from willnationsdev/script-iconRémi Verschelde
Fix script class icons looking for paths at runtime
2019-02-08Add a maximum recusion depth to _guess_expression_typeHein-Pieter van Braam
When a recursive declaration ends up in a GDScript file the _guess_expression_type function would start looping and eventually run out of stack space. We now cap recusion for this function to 100 frames. This fixes #25598
2019-02-06Fix script class icon filepath lookups at runtime.Will Nations
2019-02-01Fixed Null appearing inside export variables with type hints and no default ↵DualMatrix
value The default value of the type is now used to initialise it. export(int) A Will now have A be 0 istead of Null even though it still showed as 0 before in the inspector, fixes #25357
2019-01-31Fix wrong error messages for invalid arguments when calling functions ↵Bojidar Marinov
through call Fixes #25505
2019-01-30Fix many asan and ubsan reported issuesHein-Pieter van Braam
This allows most demos to run without any ubsan or asan errors. There are still some things in thirdpart/ and some things in AudioServer that needs a look but this fixes a lot of issues. This should help debug less obvious issues, hopefully. This fixes #25217 and fixes #25218
2019-01-25Ensure get script method list also checks base classes, fixes #23384Juan Linietsky
2019-01-23GDScript: do second pass of parsing on releaseGeorge Marques
Some construct (like match) actually depends on the second pass. This adds some extra checks to not perform specific type-checks on release since not all type information is available.
2019-01-23GDScript: fix default value for autoexported typed varsGeorge Marques
2019-01-23GDScript: read constants from parent scriptsGeorge Marques
This is needed to create export variables from enums defined in a parent class.
2019-01-23GDScript: don't allow calling non-static function from scriptGeorge Marques
2019-01-23GDScript: allow local classes to be used as typesGeorge Marques
2019-01-18GDScript: Fix return value of "lerp" builtinRémi Verschelde
Fixes #25082, fixes #24709.
2019-01-17Merge pull request #25069 from vnen/gdscript-fixesHein-Pieter van Braam
A bit more of GDScript fixes
2019-01-17GDScript compiler: check if subclass exists before comparisonGeorge Marques
Otherwise these checks might trigger the insertion of an empty value, leading to crashes.
2019-01-16GDScript: clarify error message about cyclesGeorge Marques
They may happen with any cyclic dependency, not only with inheritance.
2019-01-16GDScript: fix type-check of indexed valuesGeorge Marques
2019-01-16Merge pull request #25001 from jlahman/gdscript-export-var-fixRémi Verschelde
Fixes export PackedScene "reset to default" throwing errors
2019-01-15Fixes export PackedScene "reset to default" throwing errorsjlahman
When exporting variables from a gdscript, default values of uninitialized variables would never be set. This caused the default value to be Variant::NIL, and when a user tried to reset the variable through the editor, an error would be thrown because too few arguments would be counted(end of argument list for calls are detected by NIL values). Fixed by simply setting default value to an empty variant of the proper type in gdscript parser.
2019-01-15GDScript: check for underscore prefix when type-checkingGeorge Marques
Some classes are represented internally with an underscore prefix, so we need to make sure we match this representation when type-checking, otherwise the check might fail on a valid scenario.
2019-01-15GDScript: consider constructors as always existingGeorge Marques
There's always a constructor, even if implicit, especially for native types. Also don't check for signature match on function call, since this information is not available in release builds.
2019-01-15GDScript: allow objects to be keys of dictionariesGeorge Marques
The engine allows this already, so the parser should not fail in this case.
2019-01-15GDScript: don't check types on release buildsGeorge Marques
A lot of information is missing on release, and the checks might take a performance hit. Also, having GDScript more lenient on release is usually desirable.
2019-01-15GDScript autocomplete: don't carry values when guessing from `is`George Marques
Guessing the type from an `is` operator should no be considered an assigment. This would cause crashes in certain scenarios.
2019-01-10Merge pull request #24877 from neikeq/issue-24280Rémi Verschelde
Fix properties being lost when reloading placeholder GDScript instance
2019-01-10Merge pull request #24883 from akien-mga/resourceformat-unregisterRémi Verschelde
Consistency in resource format saver/loader de-registration
2019-01-10Fix broken encrypted scripts during exportAndrii Doroshenko (Xrayez)
Use temporary cache directory instead of editor settings directory in order to resolve encrypted file access needed for encrypting scripts on all platforms.
2019-01-10Consistency in resource format saver/loader de-registrationRémi Verschelde
Some used 'is_valid()' checks, others not. Validity is already checked in 'unref()', and 'remove_resource_format_*()' has an ERR_FAIL condition on 'is_null()' already (which shouldn't happen since we're only unregistering things that we previously registered. Also add missing GDCLASS statement in ResourceFormatLoaderVideoStreamGDNative, missed in #20552 which was last amended before #19501 was merged.
2019-01-10Fix properties being lost when reloading placeholder GDScript instanceIgnacio Etcheverry
During reloading in `GDScriptLanguage::reload_all_scripts` a placeholder instance that must remain so is replaced with a new placeholder instance. The state is then restored by calling `ScriptInstance::set` for each property. This does not work if the script is missing the properties due to build/parse failing. The fix for such cases is to call `placeholder_set_fallback` instead of `set` on the script instance. I took this chance to move the `build_failed` flag from `PlaceHolderScriptInstance` to `Script`. That improves the code a lot. I also renamed it to `placeholder_fallback_enabled` which is a much better name (`build_failed` could lead to misunderstandings).
2019-01-05Fix code completion on nodes in current sceneTimo Schwarzer
2019-01-04Merge pull request #24741 from ↵Rémi Verschelde
timoschwarzer/24697-fix-autocomplete-segfault-in-inner-classes Fix segfault when trying to autocomplete in inner classes
2019-01-04Merge pull request #24582 from Xrayez/script-encryptRémi Verschelde
Bring back script encryption in export preset
2019-01-03Fix segfault when trying to autocomplete in inner classesTimo Schwarzer
Fixes #24697
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-24Bring back script encryption in export presetAndrii Doroshenko (Xrayez)
Retrieved working implementation from 2.1 branch and adapted to existing export preset system. Added Script tab in export preset to export script as raw text, compiled, or encrypted (same as in 2.1). The script encryption key is visually validated. The script export mode and the key is saved per per preset in `export_presets.cfg`, so it makes sense to ignore this file in version control system. Each custom exporting procedure can retrieve an export preset set during project exporting. Refactored project export dialog a bit to allow easier code comprehension.
2018-12-16Merge pull request #19501 from Zylann/custom_loadersRémi Verschelde
Added basic support for custom resource savers and loaders
2018-12-15Added basic support for custom resource savers and loadersMarc Gilleron
2018-12-13i18n: Sync translation template with current sourceRémi Verschelde
Also French translation update and misc fixes to source strings.
2018-12-07Fix type-compatibilty check in GDScriptGeorge Marques
Objects and PoolArrays are properly tested for conversion.
2018-12-07Merge pull request #22934 from SeleckyErik/issue-11457Rémi Verschelde
GDscript function str2var now returns null on invalid input
2018-11-28GDscript function str2var now returns input string on invalid inputErik
str2var used to raise a blocking error when invalid input was passed. Now it logs an error message and returns the input string. This solution was proposed in #13021. Closes #11457 and #13021.
2018-11-28Fix many errors found by PVS-StudioAaron Franke
Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15.