summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/parser
Commit message (Collapse)AuthorAgeFilesLines
* Style: Trim trailing whitespace and ensure newline at EOFRémi Verschelde2024-05-081-1/+0
| | | | Found by apply the file_format checks again via #91597.
* Add PackedVector4Array Variant typeK. S. Ernest (iFire) Lee2024-05-032-0/+4
| | | | | Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* GDScript: Suppress unused constant warning with underscoreGeorge Marques2024-04-184-52/+9
| | | | | | The warning message mentions that local constants prefixed with `_` does not generate the warning. This commit actually implements this warning suppression.
* Merge pull request #89472 from dalexeev/gds-fix-bin-tokenizer-continuation-linesRémi Verschelde2024-04-152-0/+14
|\ | | | | | | GDScript: Fix continuation lines in `GDScriptTokenizerBuffer`
| * GDScript: Fix continuation lines in `GDScriptTokenizerBuffer`Danil Alexeev2024-04-102-0/+14
| |
* | Fix multiline array/dictionary match statementsAiden Storey2024-04-124-0/+63
| | | | | | | | | | | | | | | | | | | | | | Currently array and dictionary expressions cannot be spread over multiple lines in match statements. Adding mutliline push/pop while parsing the pattern for bracket and brace enables the ability for these to be multiline. This enables more complex patterns to be matched without exceeding line limits. Fixes #90372
* | GDScript: Don't warn on unassigned for builtin-typed variablesGeorge Marques2024-04-102-3/+23
|/ | | | | | | | | | | If the type of a variable is a built-in Variant type, then it will automatically be assigned a default value based on the type. This means that the explicit initialization may be unnecessary. Thus this commit removes the warning in such case. This also changes the meaning of the unassigned warning to happen when the variable is used before being assigned, not when it has zero assignments.
* GDScript: Fix `@warning_ignore` annotation issuesDanil Alexeev2024-03-128-4/+30
|
* Merge pull request #82952 from AbelToy/gds-export-arrayRémi Verschelde2024-03-069-4/+288
|\ | | | | | | Allow `@export`ed Arrays to set property hints for their elements
| * Support Array and PackedArray in @export_*Abel Toy2024-03-069-4/+288
| |
* | [GDScript] Fix some test file pathsA Thousand Ships2024-03-042-0/+0
| |
* | GDScript: Adjust STATIC_CALLED_ON_INSTANCE warning to not default to the ↵20kdc2024-03-012-9/+29
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | native type, and to not trigger on self-calls Not defaulting to the native type rationale: Defaulting to the native type is less than useful, as: * There are very few native types that are extensible and have static methods. * Defaulting to the native type does not account for a method being script-defined. While the "real fix" would be to carefully track the source of the method, the get_function_signature method is already complicated enough. This will at least ensure the resulting code should always be valid. Not triggering on self-calls rationale: Found in PR comment https://github.com/godotengine/godot/pull/85918#issuecomment-1935864459 ``` static func example(): pass func example2(): example() # self-call on static function ``` Disabling this warning on self-calls is: * Consistent with other languages * Important for anonymous classes (where the output code is unusable)
* Merge pull request #82122 from dalexeev/gds-add-export-hidden-annotationRémi Verschelde2024-02-276-69/+105
|\ | | | | | | GDScript: Add `@export_storage` annotation
| * GDScript: Add `@export_storage` annotationDanil Alexeev2023-12-196-69/+105
| |
* | GDScript: Reintroduce binary tokenization on exportGeorge Marques2024-02-083-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | GDScript: Add `is not` operatorDanil Alexeev2024-02-042-0/+17
| |
* | Revert "Add UID support to GDScript files"Rémi Verschelde2024-01-298-26/+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.
* | Add UID support to GDScript fileskobewi2024-01-178-0/+26
| |
* | GDScript: Allow empty parentheses for property getter declarationDanil Alexeev2023-10-112-0/+6
|/
* GDScript: Add error when exporting node in non [Node]-derived classesDanil Alexeev2023-10-052-1/+8
|
* Merge pull request #80085 from vnen/gdscript-pattern-guardsYuri Sizov2023-09-284-0/+12
|\ | | | | | | GDScript: Implement pattern guards for match statement
| * GDScript: Implement pattern guards for match statementGeorge Marques2023-09-274-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | GDScript: Improve call analysisDanil Alexeev2023-09-216-0/+11
|/ | | | | | * Add missing `UNSAFE_CALL_ARGUMENT` warning. * Fix `Object` constructor. * Display an error for non-existent static methods.
* GDScript: Add raw string literals (r-strings)Danil Alexeev2023-09-118-0/+57
|
* GDScript: Allow mixed indentation on blank linesDanil Alexeev2023-08-173-0/+26
|
* Change explicit 'Godot 4.0' references to 'Godot 4'Rémi Verschelde2023-07-101-1/+1
| | | | Fixes #79276.
* Fix lambda parsing continuing on subsequent lines #73273今井きなみ2023-06-214-0/+92
|
* Merge pull request #73363 from dalexeev/gds-fix-min-int-not-representableRémi Verschelde2023-06-182-0/+33
|\ | | | | | | GDScript: Fix `MIN_INT` not representable as numeric literal
| * GDScript: Fix `MIN_INT` not representable as numeric literalDanil Alexeev2023-02-152-0/+33
| |
* | GDScript: Fix repeated `_` are allowed after decimal pointDanil Alexeev2023-06-146-11/+53
| |
* | GDScript: Reorganize and unify warningsDanil Alexeev2023-04-2814-26/+26
| |
* | Add support for static variables in GDScriptGeorge Marques2023-04-274-0/+15
| | | | | | | | | | | | | | | | | | | | 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.
* | GDScript: Add some checks for `@tool` and `@icon`Danil Alexeev2023-04-204-0/+14
| |
* | Merge pull request #72979 from dalexeev/gds-annotation-parsingYuri Sizov2023-04-174-0/+67
|\ \ | | | | | | GDScript: Fix and improve annotation parsing
| * | GDScript: Fix and improve annotation parsingDanil Alexeev2023-04-144-0/+67
| | |
* | | fix access to identifiers that are reserved keywordsajreckof2023-04-142-0/+37
|/ /
* | Fix GDScript code style regarding colonDanil Alexeev2023-03-052-5/+7
| |
* | Minor typo and docs URL fixesRémi Verschelde2023-02-281-1/+1
| |
* | GDScript: Fix parsing unexpected break/continue in lambdaDmitrii Maganov2023-02-234-0/+22
|/
* Merge pull request #72971 from vnen/gdscript-multiline-commentRémi Verschelde2023-02-094-6/+24
|\ | | | | | | GDScript: Allow strings as multiline comments
| * GDScript: Allow strings as multiline commentsGeorge Marques2023-02-094-6/+24
| | | | | | | | Bring back the behavior in 3.x that was left out by oversight.
* | GDScript: Be more lenient with identifiersGeorge Marques2023-02-096-1/+39
|/ | | | | | - 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.
* Revert "Remove script class checks when getting function signature"Rémi Verschelde2023-02-072-14/+0
| | | | | | This reverts commit 0fef203b1f39c3373f9f25b8e75e75f6b03f7c88. This introduced some other issues, as discussed in #72144.
* Remove script class checks when getting function signatureAdam Scott2023-02-072-0/+14
|
* Fix global script class parsing.Juan Linietsky2023-01-311-1/+1
| | | | | | | | * Broke with #72226 * Restored previous version of the code, made it even more error tolerant. * Added a warning to **not** change the code. Fixes #72226.
* GDScript: Fix `@export_enum` works only with `int`Danil Alexeev2023-01-302-0/+22
|
* Merge pull request #72285 from vnen/gdscript-variable-matchRémi Verschelde2023-01-292-0/+27
|\ | | | | GDScript: Allow variables in match patterns
| * GDScript: Allow variables in match patternsGeorge Marques2023-01-282-0/+27
| | | | | | | | To restore an ability available in 3.x and reduce compatibility changes.
* | GDScript: Fix constant conversionsDmitrii Maganov2023-01-291-4/+4
|/
* GDScript: Allow constant expressions in annotationsDanil Alexeev2023-01-252-2/+2
|