summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add support for static variables in GDScriptGeorge Marques2023-04-271-28/+58
| | | | | | | | | | 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.
* Merge pull request #72095 from anvilfolk/gd-docsYuri Sizov2023-04-261-3/+14
|\ | | | | Improve GDScript documentation generation & behavior
| * Improve and fix GDScript documentation generation & behaviorocean (they/them)2023-04-211-3/+14
| | | | | | | | | | | | 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.
* | Merge pull request #75605 from anvilfolk/type-baseRémi Verschelde2023-04-241-3/+0
|\ \ | |/ |/| | | Make GDScript type not found errors more informative.
| * Make type not found errors more informative.ocean (they/them)2023-04-021-3/+0
| | | | | | | | | | | | | | This PR removes a check for whether a datatype is a meta type when generating a datatype's to_string() result. This means that error messages that fail to find the type will now print their class names, which is much more useful when trying to identify errors.
* | GDScript: Add some checks for `@tool` and `@icon`Danil Alexeev2023-04-201-0/+16
| |
* | Merge pull request #72979 from dalexeev/gds-annotation-parsingYuri Sizov2023-04-171-17/+22
|\ \ | | | | | | GDScript: Fix and improve annotation parsing
| * | GDScript: Fix and improve annotation parsingDanil Alexeev2023-04-141-17/+22
| | |
* | | Merge pull request #62830 from ajreckof/access-identifier-keywordsYuri Sizov2023-04-171-0/+3
|\ \ \ | |/ / |/| | fix access to identifiers that are reserved keywords
| * | fix access to identifiers that are reserved keywordsajreckof2023-04-141-0/+3
| |/
* / Fix mistakes in documentation and GDScript errorsVolTer2023-04-101-6/+5
|/
* GDScript: Change parser representation of class extendsDmitrii Maganov2023-03-131-3/+3
|
* Merge pull request #73410 from MewPurPur/Fixin-error-spam-2-Electric-BoogalooRémi Verschelde2023-03-081-1/+1
|\ | | | | | | Fix error spam when naming a func at the end of the script
| * Fix error spam when naming a func at the end of the scriptVolTer2023-03-071-1/+1
| |
* | GDScript: Fix parsing unexpected break/continue in lambdaDmitrii Maganov2023-02-231-0/+13
| |
* | GDScript: Rework type checkDmitrii Maganov2023-02-171-7/+26
|/
* GDScript: Remove `treat_warnings_as_errors` project settingDanil Alexeev2023-02-101-1/+1
|
* Merge pull request #72971 from vnen/gdscript-multiline-commentRémi Verschelde2023-02-091-15/+51
|\ | | | | | | GDScript: Allow strings as multiline comments
| * GDScript: Allow strings as multiline commentsGeorge Marques2023-02-091-15/+51
| | | | | | | | Bring back the behavior in 3.x that was left out by oversight.
* | GDScript: Be more lenient with identifiersGeorge Marques2023-02-091-2/+14
|/ | | | | | - Allow identifiers similar to keywords if they are in ASCII range. - Allow constants to be treated as regular identifiers. - Allow keywords that can be used as identifiers in expressions.
* GDScript: Improve validation and documentation of `@export_flags`Danil Alexeev2023-02-071-13/+40
|
* Merge pull request #72804 from vnen/gdscript-no-onready-without-nodeYuri Sizov2023-02-061-1/+1
|\ | | | | GDScript: Fix inheritance check of @onready for inner classes
| * GDScript: Fix inheritance check of @onready for inner classesGeorge Marques2023-02-061-1/+1
| |
* | Merge pull request #72708 from KoBeWi/PackedMultilineStringArrayYuri Sizov2023-02-061-0/+7
|\ \ | |/ |/| Fix @export_multiline for PackedStringArray
| * Fix @export_multiline for PackedStringArraykobewi2023-02-041-0/+7
| |
* | Merge pull request #72330 from MinusKube/unreachable_code_bugRémi Verschelde2023-02-061-0/+8
|\ \ | | | | | | | | | Fix unreachable code warning for elif block
| * | Fix unreachable code warning for elif blockMinusKube2023-01-291-0/+8
| | |
* | | Merge pull request #72794 from vnen/gdscript-no-onready-without-nodeRémi Verschelde2023-02-061-0/+4
|\ \ \ | | | | | | | | | | | | GDScript: Don't allow @onready without inheriting Node
| * | | GDScript: Don't allow @onready without inheriting NodeGeorge Marques2023-02-061-0/+4
| | | |
* | | | GDScript: Better handling of `@rpc` annotation and autocompletionDanil Alexeev2023-02-051-11/+31
|/ / /
* | | Merge pull request #72608 from vnen/gdscript-warning-default-errorYuri Sizov2023-02-051-7/+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-7/+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.
* / | Improve docs for rpc annotationsGeroVeni2023-02-041-1/+1
|/ /
* | GDScript: Fix crash in export group annotationsDanil Alexeev2023-02-021-1/+6
| |
* | Revert "GDScript: Add warnings that are set to error by default"Rémi Verschelde2023-02-011-7/+7
| | | | | | | | | | | | | | | | | | This reverts commit a166833bfa23a21a7bff196a85a20b014e7c1396. This caused multiple regressions. Needs to be redone with more testing before merge. Fixes #72501.
* | GDScript: Add warnings that are set to error by defaultGeorge Marques2023-02-011-7/+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: Fix `@icon` annotationDanil Alexeev2023-01-311-4/+30
| |
* | GDScript: Fix issues with typed arraysDmitrii Maganov2023-01-311-43/+5
| |
* | GDScript: Fix match branches return check on releaseGeorge Marques2023-01-301-5/+1
| | | | | | | | | | | | The check for existence of `return` only existed on debug builds for match branches. This could lead on an invalid error after exporting. Now this is checked on relase too, so it works the same as the editor.
* | Merge pull request #72305 from dalexeev/gfs-fix-export-enumRémi Verschelde2023-01-301-1/+23
|\ \ | | | | | | | | | GDScript: Fix `@export_enum` works only with `int`
| * | GDScript: Fix `@export_enum` works only with `int`Danil Alexeev2023-01-301-1/+23
| | |
* | | Merge pull request #72175 from dalexeev/gds-fix-export-group-annotationsRémi Verschelde2023-01-301-3/+7
|\ \ \ | |/ / |/| | | | | GDScript: Fix broken export group annotations
| * | GDScript: Fix broken export group annotationsDanil Alexeev2023-01-271-3/+7
| |/
* / GDScript: Allow variables in match patternsGeorge Marques2023-01-281-11/+3
|/ | | | To restore an ability available in 3.x and reduce compatibility changes.
* GDScript: Allow constant expressions in annotationsDanil Alexeev2023-01-251-62/+4
|
* Merge pull request #71120 from jordigcs/ternaryGeorge Marques2023-01-251-0/+1
|\ | | | | Closes https://github.com/godotengine/godot/issues/71065
| * Allow standalone ternary expressionsjordi2023-01-191-0/+1
| |
* | Clarify error message about script-level annotationDanil Alexeev2023-01-241-1/+5
| |
* | Merge pull request #71914 from vnen/gdscript-no-continue-matchRémi Verschelde2023-01-231-19/+1
|\ \ | | | | | | | | | GDScript: Remove function of `continue` for match statement
| * | GDScript: Remove function of `continue` for match statementGeorge Marques2023-01-221-19/+1
| | | | | | | | | | | | | | | | | | The keyword is confusing and rarely is used in the intended way. It is removed now in favor of a future feature (pattern guards) to avoid breaking compatibility later.