summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
* Add GDScript slave keyword deprecation warning.Fabio Alessandrelli2018-09-151-0/+1
|
* Clearly deprecate sync too in favor of remotesync.Fabio Alessandrelli2018-09-151-1/+1
| | | | | NOTE: This changes the RPC_MODE_* enum values. Games should be re-exported. GDNative rebuilt.
* Rename slave keyword to puppetFabio Alessandrelli2018-09-151-6/+7
| | | | | The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
* Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-9/+9
|\ | | | | Misc. typos
| * Misc. typosluz.paz2018-09-121-9/+9
| | | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-5/+4
|/ | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Merge pull request #21449 from vnen/gdscript-builtin-isRémi Verschelde2018-08-271-3/+38
|\ | | | | Allow `is` operator to test built-in types
| * GDScript: Allow `is` operator to test built-in typesGeorge Marques2018-08-261-3/+38
| |
* | Merge pull request #21369 from Noshyaar/exportflagRémi Verschelde2018-08-271-2/+3
|\ \ | |/ |/| Deprecating bit flags export with no hint text
| * Deprecating bit flags export with no hint textPoommetee Ketson2018-08-241-2/+3
| |
* | Make some debug prints verbose-only, remove othersRémi Verschelde2018-08-241-3/+0
|/
* GDScript: Ignore unused arguments/local vars that start with _George Marques2018-08-211-5/+7
| | | | | Makes it simple to ignore particular arguments without adding special comments, especially in engine-defined functions.
* GDScript: Forbid invalid identifiers in match bindingsGeorge Marques2018-08-211-4/+12
| | | | Also forbid shadowing a variable from an upper scope.
* Add custom icons to script classes.Will Nations2018-08-141-0/+26
|
* Remove usage console spamChaosus2018-08-131-1/+0
|
* Added system for GDScript warningsGeorge Marques2018-08-101-32/+397
| | | | | | | - Count and panel per script. - Ability to disable warnings per script using special comments. - Ability to disable warnings globally using Project Settings. - Option to treat enabled warnings as errors.
* Allow some non-integer built-in constants in gdscriptBernhard Liebl2018-07-311-2/+2
|
* GDScript: Fix parse error in string formattingGeorge Marques2018-07-261-1/+1
|
* GDScript: Add type inference syntax for function argumentsGeorge Marques2018-07-251-11/+19
|
* GDScript: Fix type detection for String formatting operatorGeorge Marques2018-07-251-0/+3
|
* GDScript: Allow accessing constants of outer classesGeorge Marques2018-07-251-0/+3
|
* GDScript: Fix bogus error when a cursor token is found on classGeorge Marques2018-07-251-0/+3
|
* GDScript: Fix mismatching between export hint and type hintGeorge Marques2018-07-251-0/+2
|
* GDScript: Allow inherited method to add optional argumentsGeorge Marques2018-07-251-3/+30
| | | | Also show the parent method signature in the error message.
* GDScript: Look up local scope first for detecting typeGeorge Marques2018-07-251-22/+20
|
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-16/+16
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Rewrite code completionGeorge Marques2018-07-201-17/+22
| | | | | | - Use data type struct from the parser. - Avail from type hints when type can't be guessed. - Consider inner classes and other scripts when looking for candidates.
* Add ability to infer variable type from assigned valueGeorge Marques2018-07-201-3/+46
| | | | | Syntax: var x : = 42 Infers the type of "x" to be an integer.
* Add editor highlight for type-safe linesGeorge Marques2018-07-201-99/+175
| | | | | The line number is hightlighted to indicate that the line contains only type-safe code.
* Fix line number detection in some parser nodesGeorge Marques2018-07-201-4/+14
|
* Use type information to enable GDScript introspectionGeorge Marques2018-07-201-0/+50
| | | | | This makes the Script API provide accurate information when requesting property or method info.