summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* GDScript: Check function arguments on release tooGeorge Marques2020-01-131-4/+0
| | | | | | | | Needed because otherwise the certain type operations (such as type casting) used as a function argument might become unresolved on release, causing a compilation failure. Fix #28680
* GDScript: Type match on assignment only if operators have typeGeorge Marques2020-01-131-8/+2
| | | | | This ensures that a value without type won't be wrongly assigned to a typed variable when the types mismatch.
* GDScript: Forbid using "script" as member nameGeorge Marques2020-01-101-3/+9
| | | | | Avoids the user breaking things by creating a "script" variable with something else, effectively overwriting the "script" slot on Object.
* GDScript: Fix type name on error message for function parametersGeorge Marques2020-01-091-1/+1
|
* GDScript: Fix resolution of default parameter valuesGeorge Marques2020-01-091-1/+1
| | | | Fix #26556
* Merge pull request #34948 from vnen/gdscript-copy-constructorRémi Verschelde2020-01-091-0/+11
|\ | | | | GDScript: Allow copy constructor for built-in types
| * GDScript: Allow copy constructor for built-in typesGeorge Marques2020-01-091-0/+11
| | | | | | | | Those are implicitly defined in Variant.
* | Add GDScript warning for standalone expressionGeorge Marques2020-01-091-1/+5
|/ | | | | This makes the error message clearer as it might be used to call functions with side effects.
* GDScript: set assign operation on local var made by matchGeorge Marques2020-01-081-1/+1
| | | | | | | This is needed in a all local variables with assigment to properly set the typed operation. Fix #34928
* Merge pull request #34918 from vnen/gdscript-assign-opRémi Verschelde2020-01-081-6/+10
|\ | | | | GDScript: enable type checks on release mode
| * GDScript: enable type checks on release modeGeorge Marques2020-01-081-6/+10
| | | | | | | | | | Also make builtin GDScript functions report return type as Variant in release so type is converted when needed.
* | GDScript: properly set type of local variable initializationGeorge Marques2020-01-081-0/+1
|/ | | | | | | Properly sets the type of the identifier for the local variable that is stored in the assignment operation. This makes sure that the compiler is aware of typing for local variables when they are initialized with the declaration.
* Allow the usage of newlines in export hintsBojidar Marinov2020-01-021-40/+48
| | | | Fixes #34689
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* GDScript: Fix type conversion in assignment with operationGeorge Marques2019-12-131-17/+24
|
* Merge pull request #34067 from bojidar-bg/32370-retype-messageRémi Verschelde2019-12-041-1/+6
|\ | | | | Make error when accidentially redeclaring a variable's type clearer
| * Make error when accidentially redeclaring a variable's type clearerBojidar Marinov2019-12-021-1/+6
| | | | | | | | Fixes #32370
* | Parser: Check all the arguments of the ternary operatorlupoDharkael2019-11-151-0/+2
|/
* Add setting to exclude addons from script warningsmashumafi2019-11-071-0/+3
|
* Merge pull request #32808 from bojidar-bg/30937-less-strict-mixed-spacingRémi Verschelde2019-10-251-26/+50
|\ | | | | Allow mixed tabs and spaces when indentation does not depend on tab size
| * Allow mixed tabs and spaces when indentation does not depend on tab sizeBojidar Marinov2019-10-251-26/+50
| | | | | | | | (hopefully) Closes #30937, fixes #32612
* | Merge pull request #32919 from vnen/gdscript-unused-argsRémi Verschelde2019-10-221-5/+17
|\ \ | | | | | | Fix wrong counting of function argument usage
| * | Fix wrong counting of function argument usageGeorge Marques2019-10-191-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | There's no need to subtract 1 from the assignment usages because it's not incremented anywhere else. Also put back the assignment with operators because they should not count as usage if the argument is on the left side.
* | | GDScript: Add _ prefix on class name in type compatibility checkGeorge Marques2019-10-191-1/+7
|/ / | | | | | | | | | | This makes sure that the classes internally represented with an underscore (_) prefix, such as singletons, are still properly checked for inheritance in the ClassDB.
* / Small fixes to redundand code, copy paste bugsqarmin2019-10-141-3/+1
|/
* GDScript: Fix type resolution not being return in some casesGeorge Marques2019-09-241-1/+2
| | | | | | Some situations caused the parser node type to not being update when trying to resolve the type, returning invalid data and breaking the parsing when it shouldn't. This patch fix the behavior.
* Changed some code found by Clang Tidy and Coverityqarmin2019-09-221-3/+0
|
* Merge pull request #32150 from luzpaz/typosRémi Verschelde2019-09-201-1/+1
|\ | | | | Fix misc. source comment typos
| * Fix misc. source comment typosluz.paz2019-09-191-1/+1
| | | | | | Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
* | Merge pull request #31921 from bojidar-bg/28978-uninitialized-array-valueRémi Verschelde2019-09-191-33/+44
|\ \ | | | | | | Fix uninitialized arrays and dictionaries retaining value
| * | Fix uninitialized arrays and dictionaries retaining valueBojidar Marinov2019-09-031-33/+44
| |/ | | | | | | Fixes #28978
* | Merge pull request #32100 from SaracenOne/gdscript_parent_const_typesRémi Verschelde2019-09-191-14/+21
|\ \ | | | | | | Fix const deceleration for inherited scripts above immediate parent
| * | Allow for constant deceleration to be detected inherited scripts above the ↵Saracen2019-09-111-14/+21
| |/ | | | | | | immediate parent.
* | Merge pull request #31934 from mitchcurtis/28187Rémi Verschelde2019-09-191-0/+9
|\ \ | | | | | | Produce an error when a class has the same name as a Singleton
| * | Produce an error when a class has the same name as a SingletonMitch Curtis2019-09-061-0/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you somehow end up with a Singleton.gd that looks like this: extends Node class_name Singleton func foo(): pass You will get an error when using it in another file: extends Node2D func _init(): # Parser Error: Non-static function "foo" can only be called from an instance. Singleton.foo() This error is confusing. This patch ensures that an error on the class_name line will be produced: Parse Error: The class "Singleton" conflicts with the AutoLoad singleton of the same name, and is therefore redundant. Remove the class_name declaration to fix this error. Fixes #28187.
* / GDScript: add an optional message parameter to assert()Mitch Curtis2019-09-111-6/+27
|/ | | | | | | | | | | | | | | | | Before this patch, assert() only took the condition to assert on: assert(item_data) Now, it can optionally take a string that will be printed upon failure: assert(item_data, item_name + " has no item data in ItemDatabase") This makes it easier to immediately see what the issue is by being able to write informative failure messages. Thanks to @wiped1 for sharing their patch, upon which this is based. Closes #17082
* Merge pull request #31893 from bojidar-bg/25081-gdscript-index-selfRémi Verschelde2019-09-021-1/+1
|\ | | | | Re-allow indexing on objects and other non-builtin types
| * Re-allow indexing on "self" and object types in GDScriptBojidar Marinov2019-09-021-1/+1
| | | | | | | | Fixes #25081
* | Merge pull request #31843 from 2shady4u/parserCtrlClickRémi Verschelde2019-09-021-1/+11
|\ \ | | | | | | Solves ctrl+click on functions by ignoring the cursor
| * | Solves ctrl+click on functions by ignoring the cursorshaderbeast2019-09-021-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obeyed CLANG format rules Obeying CLANG format rules attempt 2 Obeying CLANG format rules attempt 3 Clean up Fixed runaway while loop Removed int initialization
* | | Merge pull request #24925 from Mr-Slurpy/typed-autoloadRémi Verschelde2019-09-021-2/+67
|\ \ \ | |_|/ |/| | Added autoloads as a potential type.
| * | Added autoloads as a potential type.Daniel Eliasinski2019-01-111-2/+67
| | |
* | | Merge pull request #31738 from bojidar-bg/31056-class_name-extendsRémi Verschelde2019-08-291-1/+1
|\ \ \ | | | | | | | | Remove check for class_name and extends order
| * | | Remove check for class_name and extends orderBojidar Marinov2019-08-281-1/+1
| | | | | | | | | | | | | | | | Closes #31056
* | | | Merge pull request #29780 from GodotExplorer/gdscript-lspRémi Verschelde2019-08-281-0/+4
|\ \ \ \ | |/ / / |/| | | Add Language Server Protocol for GDScript
| * | | Add GDScript Language Protocol plugingeequlim2019-08-111-0/+4
| | | |
* | | | Make 'break' and 'continue' be marked as safeMichael Alexsander Silva Dias2019-08-271-2/+4
| | | |
* | | | Improve writing style in GDScript error/warning messagesHugo Locurcio2019-08-231-224/+224
| | | | | | | | | | | | | | | | This uses double quotes everywhere for consistency.
* | | | Replace last occurrences of 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG'Rémi Verschelde2019-08-171-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | The last remaining ERR_EXPLAIN call is in FreeType code and makes sense as is (conditionally defines the error message). There are a few ERR_EXPLAINC calls for C-strings where String is not included which can stay as is to avoid adding additional _MSGC macros just for that. Part of #31244.
* | | Merge pull request #31227 from profan/fix/err-explain-usagesRémi Verschelde2019-08-091-10/+4
|\ \ \ | | | | | | | | Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", "modules/gdnative", "modules/gdscript" directories.