summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Forbid implicit type conversion in GDScript"Rémi Verschelde2019-03-041-10/+95
|
* Merge pull request #26562 from vnen/gdscript-no-implicit-castRémi Verschelde2019-03-041-95/+10
|\ | | | | Forbid implicit type conversion in GDScript
| * GDScript: Forbid implicit type conversionGeorge Marques2019-03-031-95/+10
| | | | | | | | | | Since types are not present in release builds, this could cause issues where a variable does not have the exact defined type.
* | GDScript: Fix issue when detecting file class in inner classGeorge Marques2019-03-031-1/+1
| |
* | GDScript: Allow `for` iterator to be rededefinedGeorge Marques2019-03-031-1/+0
|/
* Merge pull request #26547 from vnen/gdscript-dependency-parseJuan Linietsky2019-03-031-28/+46
|\ | | | | Add a parse mode for GDScript which doesn't load dependencies
| * Add a dependency search mode for GDScript parserGeorge Marques2019-03-031-28/+46
| | | | | | | | | | | | | | | | - This mode avoids loading any other resource. - Search for class_name now uses this mode, to avoid loading in the scan thread. - Implement get_dependencies() for GDScript loader, now exporting dependencies only should include the preloaded resources.
* | Fix GDScript checking for assigning to a constant only in releaseBojidar Marinov2019-03-031-7/+10
|/
* Fix GDScript exports having the wrong type of default value by converting itBojidar Marinov2019-02-261-0/+10
| | | | | Also, initialize elements of PoolArrays when resizing them in the editor. Fixes #26066.
* Merge pull request #25018 from AllanDaemon/#24895George Marques2019-02-241-2/+3
|\ | | | | Fix support for optional parameters in setters
| * Fix #24895 (support for optional parameters in setters)Allan Daemon2019-01-231-2/+3
| |
* | Request to use load when cyclic reference is found, closes #26119Juan Linietsky2019-02-211-1/+1
| |
* | Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-32/+32
| | | | | | | | Fixes #25316.
* | Fix typos with codespellRémi Verschelde2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | Merge pull request #25481 from hpvb/fix-ubsan-asan-reportsRémi Verschelde2019-02-121-0/+4
|\ \ | | | | | | Fix many asan and ubsan reported issues
| * | Fix many asan and ubsan reported issuesHein-Pieter van Braam2019-01-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge pull request #25550 from DualMatrix/fix-25357Rémi Verschelde2019-02-121-0/+19
|\ \ \ | | | | | | | | Fixed Null appearing inside export variables with type hints and no default value
| * | | Fixed Null appearing inside export variables with type hints and no default ↵DualMatrix2019-02-011-0/+19
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge pull request #25650 from willnationsdev/script-iconRémi Verschelde2019-02-091-8/+12
|\ \ \ | |/ / |/| | Fix script class icons looking for paths at runtime
| * | Fix script class icon filepath lookups at runtime.Will Nations2019-02-061-8/+12
| |/
* | GDScript: do second pass of parsing on releaseGeorge Marques2019-01-231-6/+9
| | | | | | | | | | | | 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.
* | GDScript: fix default value for autoexported typed varsGeorge Marques2019-01-231-1/+1
| |
* | GDScript: read constants from parent scriptsGeorge Marques2019-01-231-0/+15
| | | | | | | | | | This is needed to create export variables from enums defined in a parent class.
* | GDScript: allow local classes to be used as typesGeorge Marques2019-01-231-0/+6
|/
* Merge pull request #25069 from vnen/gdscript-fixesHein-Pieter van Braam2019-01-171-26/+16
|\ | | | | A bit more of GDScript fixes
| * GDScript: clarify error message about cyclesGeorge Marques2019-01-161-3/+3
| | | | | | | | They may happen with any cyclic dependency, not only with inheritance.
| * GDScript: fix type-check of indexed valuesGeorge Marques2019-01-161-23/+13
| |
* | Merge pull request #25001 from jlahman/gdscript-export-var-fixRémi Verschelde2019-01-161-0/+4
|\ \ | |/ |/| Fixes export PackedScene "reset to default" throwing errors
| * Fixes export PackedScene "reset to default" throwing errorsjlahman2019-01-151-0/+4
| | | | | | | | | | | | 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.
* | GDScript: consider constructors as always existingGeorge Marques2019-01-151-8/+7
| | | | | | | | | | | | | | | | 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.
* | GDScript: allow objects to be keys of dictionariesGeorge Marques2019-01-151-1/+1
| | | | | | | | | | The engine allows this already, so the parser should not fail in this case.
* | GDScript: don't check types on release buildsGeorge Marques2019-01-151-1/+1
|/ | | | | | 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.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix type-compatibilty check in GDScriptGeorge Marques2018-12-071-8/+13
| | | | Objects and PoolArrays are properly tested for conversion.
* Merge pull request #23740 from ttencate/unused_argument_22139Rémi Verschelde2018-11-231-12/+15
|\ | | | | Prevent unused_argument warning when passing arg to parent constructor
| * Prevent unused_argument warning when passing arg to parent constructorThomas ten Cate2018-11-161-12/+15
| | | | | | | | | | | | | | | | | | | | | | This requires creating the FunctionNode object a bit sooner, and setting it as the current_function while parsing the parent constructor call arguments. Note that the return type has not yet been parsed at this point, but that doesn't seem to be a problem. Fixes #22139
* | Check for valid values when checking for class membersGeorge Marques2018-11-171-0/+20
|/ | | | | | | - Check if GDScript was compiled correctly before checking its functions and properties. - Check if native class name is actually set before looking for it in the ClassDB.
* Make enum values not be script constants if enum is namedGeorge Marques2018-11-111-32/+45
| | | | | | Anonymous enums still creates script constants. Also add a check to see if name used for enum is already defined.
* Add missing flag for exported enumKanabenki2018-11-061-0/+1
|
* Removed unnecessary assignmentsWilson E. Alvarez2018-11-041-1/+0
|
* Do not make a function that returns Variant::NIL a void function. Fix #22791.J08nY2018-10-111-1/+7
|
* Remove redundant "== false" codeAaron Franke2018-10-061-1/+1
| | | | | | Some of this code has been re-organized. f
* Fix warnings on release builds (not DEBUG_ENABLED)Rémi Verschelde2018-10-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following Clang 5 warnings: ``` modules/bmp/image_loader_bmp.cpp:46:60: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] modules/bmp/image_loader_bmp.cpp:48:61: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] drivers/png/image_loader_png.cpp:231:20: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] scene/gui/graph_edit.cpp:1045:8: warning: comparison of constant 0 with expression of type 'bool' is always false [-Wtautological-constant-out-of-range-compare] core/class_db.cpp:812:13: warning: unused variable 'check' [-Wunused-variable] core/io/file_access_pack.cpp:172:11: warning: unused variable 'ver_rev' [-Wunused-variable] core/math/bsp_tree.cpp:195:13: warning: unused variable 'plane' [-Wunused-variable] core/math/bsp_tree.cpp:168:6: warning: unused variable 'plane_count' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:685:10: warning: unused variable 'ok' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:706:10: warning: unused variable 'ok' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:755:19: warning: unused variable 'var_type' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:1306:12: warning: unused variable 'err' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:158:15: warning: unused function '_get_var_type' [-Wunused-function] modules/gdscript/gdscript_parser.cpp:750:20: warning: unused variable 'lv' [-Wunused-variable] modules/gdscript/gdscript_parser.cpp:59:15: warning: unused function '_find_function_name' [-Wunused-function] scene/main/node.cpp:2489:13: warning: unused function '_Node_debug_sn' [-Wunused-function] ```
* Fix various Clang 7 warnings about unused stuffRémi Verschelde2018-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Namely: [-Wunneeded-internal-declaration] [-Wunused-comparison] [-Wunused-const-variable] [-Wunused-function] [-Wunused-private-fields] Fixes the following Clang 7 warnings: ``` editor/plugins/script_editor_plugin.cpp:1417:20: warning: function '_find_node_with_script' is not needed and will not be emitted [-Wunneeded-internal-declaration] editor/scene_tree_dock.cpp:1859:14: warning: function '_find_last_visible' is not needed and will not be emitted [-Wunneeded-internal-declaration] modules/gdscript/gdscript_parser.cpp:7838:19: warning: equality comparison result unused [-Wunused-comparison] scene/resources/mesh.cpp:549:35: warning: unused variable '_array_types' [-Wunused-const-variable] scene/resources/mesh.cpp:563:18: warning: unused variable '_format_translate' [-Wunused-const-variable] drivers/gles3/rasterizer_scene_gles3.cpp:54:28: warning: unused function 'store_transform2d' [-Wunused-function] core/io/file_access_network.h:50:6: warning: private field 'ml' is not used [-Wunused-private-field] core/io/file_access_zip.h:93:14: warning: private field 'archive' is not used [-Wunused-private-field] core/io/resource_format_binary.h:122:6: warning: private field 'bin_meta_idx' is not used [-Wunused-private-field] core/message_queue.h:47:9: warning: private field 'mutex' is not used [-Wunused-private-field] main/tests/test_gui.cpp:63:11: warning: private field 'control' is not used [-Wunused-private-field] modules/gdscript/gdscript_parser.h:558:7: warning: private field 'completion_static' is not used [-Wunused-private-field] platform/x11/os_x11.h:148:11: warning: private field 'ip_unix' is not used [-Wunused-private-field] platform/x11/os_x11.h:180:7: warning: private field 'net_wm_icon' is not used [-Wunused-private-field] platform/x11/os_x11.h:189:6: warning: private field 'audio_driver_index' is not used [-Wunused-private-field] platform/x11/os_x11.h:190:15: warning: private field 'capture_idle' is not used [-Wunused-private-field] servers/physics/body_pair_sw.h:79:6: warning: private field 'cc' is not used [-Wunused-private-field] servers/visual/visual_server_raster.h:62:7: warning: private field 'draw_extra_frame' is not used [-Wunused-private-field] ```
* Fix warnings about unhandled enum value in switch [-Wswitch]Rémi Verschelde2018-09-271-2/+12
| | | | | | | | | | | Fixes GCC 5 warnings of the form: core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch] core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch] Those can be trivial cases where adding a default fallback is the solution, or more complex issues/hidden bugs where missed values are actually meant to be handled.
* Fix invalid comparison warnings: [-Wbool-compare] and [-Wenum-compare]Rémi Verschelde2018-09-271-1/+1
| | | | | | | | | | | | | Fixes the following GCC 5 warnings and actual bugs: ``` drivers/unix/net_socket_posix.cpp:562:28: warning: comparison between 'enum IP::Type' and 'enum NetSocket::Type' [-Wenum-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: comparison of constant '17' with boolean expression is always true [-Wbool-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/gdscript/gdscript_parser.cpp:5082:58: warning: comparison of constant '6' with boolean expression is always false [-Wbool-compare] modules/gdscript/gdscript_parser.cpp:5082:58: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/mbedtls/stream_peer_mbed_tls.cpp:286:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] modules/mbedtls/stream_peer_mbed_tls.cpp:313:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] ```
* GDScript: Error on empty blocks at the end of fileGeorge Marques2018-09-191-2/+6
| | | | Fix #15415
* GDScript: Forbid enum values to shadow constantsGeorge Marques2018-09-191-0/+20
| | | | | | | - Don't allow constants to shadow parent members. - Fix a spelling mistake. Fix #13175
* GDScript: Allow Object constants to be used with qualifierGeorge Marques2018-09-191-3/+15
| | | | Fix #15125
* test for depreciacion warnings only on debug buildsMariusz Chwalba2018-09-161-0/+2
| | | | Fix adherence to clang-format rules