summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_analyzer.h
AgeCommit message (Collapse)Author
2022-11-17Fix ability to overload "script" variableocean (they/them)
2022-10-13Implement RETURN_VALUE_DISCARDED warning in GDscriptclayjohn
2022-05-20Add a new HashSet templatereduz
* Intended to replace RBSet in most cases. * Optimized for iteration speed
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-04-24GDScript: Allow using self in lambdasGeorge Marques
2022-03-06GDScript: Check if method signature matches the parentGeorge Marques
To guarantee polymorphism, a method signature must be compatible with the parent. This checks if: 1. Return type is the same. 2. The subclass method takes at least the same amount of parameters. 3. The matching parameters have the same type. 4. If the subclass takes more parameters, all of the extra ones have a default value. 5. If the superclass has default values, so must have the subclass. There's a few test cases to ensure this holds up.
2022-02-03GDScript: Consolidate behavior for assigning enum typesGeorge Marques
This makes sure that assigning values to enum-typed variables are consistent. Same enum is always valid, different enum is always invalid (without casting) and assigning `int` creates a warning if there is no casting. There are new test cases to ensure this behavior doesn't break in the future.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-10-14GDScript: Remove error when coroutine is called without awaitGeorge Marques
In the case the call happens as a statement, since the return value isn't used in this case.
2021-09-02Check for GDScript member and class naming conflicts in a variety of conditions.SaracenOne
2021-08-18GDScript: Fix issue when calling `new()` on its ownGeorge Marques
2021-06-11Rename Reference to RefCountedPedro J. Estébanez
2021-04-28GDScript: Implement lambdas compilation and runtimeGeorge Marques
2021-04-28GDScript: Add lambdas to the type analyzerGeorge Marques
- Lambdas are always callables (no specific signature match). - Captures from the current context are evaluated.
2021-03-30Move GDSript annotation application after type-checkingGeorge Marques
This ensures that annotations that rely on the datatype (such as @export) can validated it timely, allowing compound expressions instead of only literal values.
2021-03-29Add typed arrays to GDScriptGeorge Marques
- 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.
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-11-26Merge pull request #43895 from vnen/gdscript-operators-fixRémi Verschelde
GDScript: Improve handling of operators
2020-11-26GDScript: Improve handling of operatorsGeorge Marques
- Use the new functions in Variant to determine the validity and resulting type of operators. - Split the operator function in codegen between binary and unary, since the unary ones have now a special requirement of having the second argument to be the NIL type when requesting info.
2020-11-26GDScript: Give an error if dependency can't be parsedGeorge Marques
Otherwise this may lead to a crash when the dependency is not present.
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-09-11Array/Dictinoary no more reduced to array/dictionary variantThakee Nathees
Fix: #41377 Fix: #20436 Fix: #41953
2020-09-06GDScript: parameter infer type bug fixThakee Nathees
Fix: #41772
2020-09-01GDScript: Don't try to parse constant scripts that aren't validGeorge Marques
Since it's likely that they won't parse correctly.
2020-08-18GDScript: Allow enum values to be set to constant expressionsGeorge Marques
Also allow them to access previous values wihout referencing the enum.
2020-08-01[GDScript] Add static HashMap cleanup.bruvzg
2020-07-22Wrap up GDScript 2.0 base implementationGeorge Marques
2020-07-20Added support for enums to be used as types in GDScriptGeorge Marques
2020-07-20Add warning checks in GDScript analyzerGeorge Marques
Reenable checking those when validating code.
2020-07-20Add new GDScript type checkerGeorge Marques
2020-07-20New GDScript tokenizer and parserGeorge Marques
Sometimes to fix something you have to break it first. This get GDScript mostly working with the new tokenizer and parser but a lot of things isn't working yet. It compiles and it's usable, and that should be enough for now. Don't worry: other huge commits will come after this.