summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #89270 from Repiteo/enforce-typename-in-templatesRémi Verschelde2024-03-141-4/+4
|\ | | | | | | Enforce template syntax `typename` over `class`
| * Enforce template syntax `typename` over `class`Thaddeus Crews2024-03-071-4/+4
| |
* | GDScript: Fix `@warning_ignore` annotation issuesDanil Alexeev2024-03-121-7/+16
|/
* GDScript: Add @export_custom annotationGeorge Marques2024-03-071-0/+1
| | | | | | Allows setting any arbitrary hint, hint string, and usage flags. Useful for more complex hints or potential future hints not available as a dedicated annotation.
* Documentation: Add support for deprecated/experimental messagesDanil Alexeev2024-02-151-0/+4
|
* GDScript: Reintroduce binary tokenization on exportGeorge Marques2024-02-081-1/+2
| | | | | | | | | | | | | | | | This adds back a function available in 3.x: exporting the GDScript files in a binary form by converting the tokens recognized by the tokenizer into a data format. It is enabled by default on export but can be manually disabled. The format helps with loading times since, the tokens are easily reconstructed, and with hiding the source code, since recovering it would require a specialized tool. Code comments are not stored in this format. The `--test` command can also include a `--use-binary-tokens` flag which will run the GDScript tests with the binary format instead of the regular source code by converting them in-memory before the test runs.
* Revert "Add UID support to GDScript files"Rémi Verschelde2024-01-291-4/+0
| | | | | | | | | | | This reverts commit c7f68a27ec4b825302998eeb5a400f869cd21cf7. We still think GDScript files need UIDs to allow safe refactoring, but we're still debating what form those should take exactly. So far there seems to be agreement that it shouldn't be done via an annotation as implemented here, so we're reverting this one for now, to revisit the feature in a future PR.
* Remove unnecessary `this->` expressionsA Thousand Ships2024-01-291-1/+1
|
* Add UID support to GDScript fileskobewi2024-01-171-0/+4
|
* Merge pull request #85487 from vnen/gdscript-static-register-annotationsYuri Sizov2023-12-191-2/+2
|\ | | | | | | GDScript: Make annotations register statically in parser
| * GDScript: Make annotations register statically in parserGeorge Marques2023-11-281-2/+2
| | | | | | | | | | So it only register the annotations once per run instead of doing it every time a script is parsed.
* | Change container_element_type to vector containerThaddeus Crews2023-12-051-24/+36
|/
* Fix typo in gdscript_parser.h and gdscript_translation_parser_plugin.cppryanabx2023-10-231-2/+2
|
* GDScript: Fix non-static call is allowed in static var lambda bodyDanil Alexeev2023-10-201-1/+1
|
* GDScript: Add error when exporting node in non [Node]-derived classesDanil Alexeev2023-10-051-10/+10
|
* Merge pull request #80085 from vnen/gdscript-pattern-guardsYuri Sizov2023-09-281-0/+1
|\ | | | | | | GDScript: Implement pattern guards for match statement
| * GDScript: Implement pattern guards for match statementGeorge Marques2023-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Within a match statement, it is now possible to add guards in each branch: var a = 0 match a: 0 when false: print("does not run") 0 when true: print("but this does") This allows more complex logic for deciding which branch to take.
* | Merge pull request #75988 from dalexeev/gds-unsafe-call-argumentYuri Sizov2023-09-271-1/+2
|\ \ | |/ |/| | | GDScript: Improve call analysis
| * GDScript: Improve call analysisDanil Alexeev2023-09-211-1/+2
| | | | | | | | | | | | * Add missing `UNSAFE_CALL_ARGUMENT` warning. * Fix `Object` constructor. * Display an error for non-existent static methods.
* | [Modules] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-261-1/+1
|/
* GDScript: Fix and improve doc comment parsingDanil Alexeev2023-09-161-2/+3
|
* Merge pull request #81079 from dalexeev/gds-fix-get-method-listRémi Verschelde2023-09-111-1/+8
|\ | | | | | | GDScript: Fix `get_*_list()` methods return incorrect info
| * GDScript: Fix `get_*_list()` methods return incorrect infoDanil Alexeev2023-09-041-1/+8
| |
* | Add coloring for completion of vector componentsYuri Rubinsky2023-08-301-0/+4
|/
* Merge pull request #75656 from YuriSizov/core-iconic-builtinsRémi Verschelde2023-08-291-0/+1
|\ | | | | | | Add a script method to get its class icon
| * Add a script method to get its class iconYuri Sizov2023-08-241-0/+1
| | | | | | | | Co-authored-by: Danil Alexeev <danil@alexeev.xyz>
* | Merge pull request #80964 from dalexeev/gds-allow-use-local-consts-as-typesYuri Sizov2023-08-251-2/+0
|\ \ | | | | | | | | | GDScript: Allow use local constants as types
| * | GDScript: Allow use local constants as typesDanil Alexeev2023-08-251-2/+0
| |/
* / GDScript: Fix lambda resolution with cyclic referencesDanil Alexeev2023-08-251-0/+2
|/
* GDScript: Add static typing for `for` loop variableDanil Alexeev2023-08-171-0/+2
|
* GDScript: Check `get_node()` shorthand in static functionsDanil Alexeev2023-08-091-2/+0
|
* Merge pull request #79880 from dalexeev/gds-fix-id-shadowing-belowYuri Sizov2023-07-311-3/+8
|\ | | | | | | GDScript: Fix bug with identifier shadowed below in current scope
| * GDScript: Fix bug with identifier shadowed below in current scopeDanil Alexeev2023-07-261-3/+8
| |
* | Merge pull request #78941 from ↵Yuri Sizov2023-07-311-14/+28
|\ \ | | | | | | | | | | | | | | | dalexeev/gds-doc-comments-deprecated-and-experimental GDScript: Add `@deprecated` and `@experimental` doc comment tags
| * | GDScript: Add `@deprecated` and `@experimental` doc comment tagsDanil Alexeev2023-07-081-14/+28
| |/
* | Merge pull request #78254 from dalexeev/gds-fix-property-group-name-conflictYuri Sizov2023-07-311-1/+3
|\ \ | |/ |/| | | GDScript: Fix conflict between property and group names
| * GDScript: Fix conflict between property and group namesDanil Alexeev2023-06-151-1/+3
| |
* | Merge pull request #77744 from dalexeev/gds-reset-block-locals-on-exitRémi Verschelde2023-06-211-1/+1
|\ \ | | | | | | | | | GDScript: Reset local variables on exit from block
| * | GDScript: Reset local variables on exit from blockDanil Alexeev2023-06-021-1/+1
| |/
* / Style: Harmonize header includes in modulesRémi Verschelde2023-06-151-4/+8
|/ | | | | | | | | | | | | | | | | | | | This applies our existing style guide, and adds a new rule to that style guide for modular components such as platform ports and modules: Includes from the platform port or module ("local" includes) should be listed first in their own block using relative paths, before Godot's "core" includes which use "absolute" (project folder relative) paths, and finally thirdparty includes. Includes in `#ifdef`s come after their relevant section, i.e. the overall structure is: - Local includes * Conditional local includes - Core includes * Conditional core includes - Thirdparty includes * Conditional thirdparty includes
* Add support for static variables in GDScriptGeorge Marques2023-04-271-8/+13
| | | | | | | | | | Which allows editable data associated with a particular class instead of the instance. Scripts with static variables are kept in memory indefinitely unless the `@static_unload` annotation is used or the `static_unload()` method is called on the GDScript. If the custom function `_static_init()` exists it will be called when the class is loaded, after the static variables are set.
* Improve and fix GDScript documentation generation & behaviorocean (they/them)2023-04-211-1/+1
| | | | | | Removes documentation generation (docgen) from the GDScript compiler to its own file. Adds support for GDScript enums and signal parameters and quite a few other assorted fixes and improvements.
* GDScript: Change parser representation of class extendsDmitrii Maganov2023-03-131-1/+1
|
* Merge pull request #73590 from vnen/gdscript-global-scope-enumsRémi Verschelde2023-02-201-0/+2
|\ | | | | | | Make global scope enums accessible as types in GDScript
| * Make global scope enums accessible as types in GDScriptGeorge Marques2023-02-191-0/+2
| | | | | | | | | | | | Add functions to CoreConstant so enums can be properly deduced. Also add the enums in release builds to make consistent with ClassDB enums and avoid differences in script compilation between debug and release.
* | GDScript: Rework type checkDmitrii Maganov2023-02-171-2/+15
|/
* Merge pull request #72608 from vnen/gdscript-warning-default-errorYuri Sizov2023-02-051-4/+7
|\ | | | | GDScript: Add warnings that are set to error by default (take 2)
| * GDScript: Add warnings that are set to error by defaultGeorge Marques2023-02-021-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adds a list of default levels for all warning so they can be set individually. - Add warnings set by default to error for: - Using `get_node()` without `@onready`. - Using `@onready` together with `@export`. - Inferring a static type with a Variant value. - Overriding a native engine method. - Adjust how annotations to ignore warnings are treated so they also apply to method parameters. - Clean up a bit how ignored warnings are set. There were two sets but only one was actually being used. - Set all warnings to the `WARN` level for tests, so they they can be properly tested. - Fix enum types in native methods signatures being set to `int`. - Fix native enums being treated as Dictionary by mistake. - Make name of native enum types use the class they are defined in, not the direct super class of the script. This ensures they are always equal even when coming from different sources. - Fix error for signature mismatch that was only showing the first default argument as having a default. Now it shows for all.
* | GDScript: Improve usability of setter chainsGeorge Marques2023-02-021-0/+2
|/ | | | | | | | | - Consider PackedArrays non-shared since they are copied on C++/script boundaries. - Add error messages in the analyzer when assigning to read-only properties. - Add specific error message at runtime when assignment fails because the property is read-only.
* Revert "GDScript: Add warnings that are set to error by default"Rémi Verschelde2023-02-011-7/+4
| | | | | | | | | This reverts commit a166833bfa23a21a7bff196a85a20b014e7c1396. This caused multiple regressions. Needs to be redone with more testing before merge. Fixes #72501.