| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Found by apply the file_format checks again via #91597.
|
|
|
|
|
| |
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
|
|
|
|
|
|
| |
The warning message mentions that local constants prefixed with `_` does
not generate the warning. This commit actually implements this warning
suppression.
|
|\
| |
| |
| | |
GDScript: Fix continuation lines in `GDScriptTokenizerBuffer`
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| |
| | |
Allow `@export`ed Arrays to set property hints for their elements
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|\
| |
| |
| | |
GDScript: Add `@export_storage` annotation
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/ |
|
| |
|
|\
| |
| |
| | |
GDScript: Implement pattern guards for match statement
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
| |
* Add missing `UNSAFE_CALL_ARGUMENT` warning.
* Fix `Object` constructor.
* Display an error for non-existent static methods.
|
| |
|
| |
|
|
|
|
| |
Fixes #79276.
|
| |
|
|\
| |
| |
| | |
GDScript: Fix `MIN_INT` not representable as numeric literal
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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: Fix and improve annotation parsing
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| |
| | |
GDScript: Allow strings as multiline comments
|
| |
| |
| |
| | |
Bring back the behavior in 3.x that was left out by oversight.
|
|/
|
|
|
|
| |
- 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.
|
|
|
|
|
|
| |
This reverts commit 0fef203b1f39c3373f9f25b8e75e75f6b03f7c88.
This introduced some other issues, as discussed in #72144.
|
| |
|
|
|
|
|
|
|
|
| |
* 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: Allow variables in match patterns
|
| |
| |
| |
| | |
To restore an ability available in 3.x and reduce compatibility changes.
|
|/ |
|
| |
|