summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_compiler.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fix error when calling coroutine with await in _readyPouleyKetchoupp2020-12-171-2/+10
| | | | | | | | | | The code paths for calling async functions seemed to be missing in some cases, causing a debug break and false positive error.
* | Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 🎆
* | Rename empty() to is_empty()Marcel Admiraal2020-12-281-2/+2
|/
* Merge pull request #43890 from vnen/gdscript-builtin-functions-refactorRémi Verschelde2020-12-151-11/+14
|\ | | | | GDScript: Refactor builtin functions
| * GDScript: Refactor builtin functionsGeorge Marques2020-11-261-11/+14
| | | | | | | | | | | | | | | | | | | | | | They are now called "utility functions" to avoid confusion with methods of builtin types, and be consistent with the naming in Variant. Core utility functions are now available in GDScript. The ones missing in core are added specifically to GDScript as helpers for convenience. Some functions were remove when there are better ways to do, reducing redundancy and cleaning up the global scope.
* | Fix base script not initialized properly in some casesPouleyKetchoupp2020-12-061-5/+8
| | | | | | | | | | | | | | | | | | | | Storing script references to pointer only in result.script_type could lead to losing the last reference, causing further conversions from Script* to Ref<Script> to fail. Now result.script_type_ref is always set first, and then cleared in the specific case of the script being the owner, to avoid cyclic reference issues.
* | Merge pull request #41095 from ThakeeNathees/GDScript-DocumentationRémi Verschelde2020-12-021-6/+69
|\ \ | | | | | | GDScript(2.0) Documentation generation system
| * | Refactor DocData into core and editor (DocTools) partsThakee Nathees2020-12-021-3/+3
| | |
| * | Documentation generation for GDScriptThakee Nathees2020-11-291-6/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - ClassDoc added to GDScript and property reflection data were extracted from parse tree - GDScript comments are collected from tokenizer for documentation and applied to the ClassDoc by the GDScript compiler - private docs were excluded (name with underscore prefix and doesn't have any doc comments) - default values (of non exported vars), arguments are extraced from the parser - Integrated with GDScript 2.0 and new enums were added. - merge conflicts fixed
* | | Merge pull request #41773 from ThakeeNathees/default-argument-override-buf-fixGeorge Marques2020-12-021-1/+1
|\ \ \ | |/ / |/| | GDScript default argument override bug fix
| * | GDScript default argument override bug fixThakee Nathees2020-11-281-1/+1
| | | | | | | | | | | | Fix: #41766
* | | GDScript: Improve handling of operatorsGeorge Marques2020-11-261-13/+13
| |/ |/| | | | | | | | | | | | | - 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.
* | Merge pull request #43856 from vnen/gdscript-some-fixesRémi Verschelde2020-11-251-1/+1
|\ \ | | | | | | A couple of GDScript fixes
| * | GDScript: Fix return of cast expression on compilationGeorge Marques2020-11-251-1/+1
| | | | | | | | | | | | It was mistakenly returning the source instead of the result.
* | | GDScript: Fix mishandling of stack pointersGeorge Marques2020-11-251-12/+24
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace the for loop temporaries by locals. They cause conflicts with the stack when being popped, while locals are properly handled in the scope. - Change the interface for the codegen so the for loop list doesn't live through the whole block if it's a temporary. - Keep track of the actual amount of local variables in the stack. Using the size of the map is misleading in cases where multiple locals have the same name (which is allowed when there's no shadowing). - Added a few debug checks for temporaries, to avoid them being wrongly manipulated in the future. They should not live more than a line of code. - Rearrange some of compiler code to make sure the temporaries don't live across blocks.
* | GDScript: Add faster call instructions for builtin methodsGeorge Marques2020-11-211-0/+2
| | | | | | | | | | Methods from builtin types can be called by using the function pointer when the argument and base types are known at compile time.
* | GDScript: Add faster call instructions for native methodsGeorge Marques2020-11-211-2/+77
| |
* | GDScript: Fix native class not set with inheritanceGeorge Marques2020-11-131-0/+2
|/
* Prevent cyclic reference between script and its membersPedro J. Estébanez2020-09-101-9/+15
|
* Fix GDScript codegen leak.bruvzg2020-09-021-0/+7
|
* Change GDScript compiler to use codegen abstractionGeorge Marques2020-09-011-1664/+980
|
* GDScript: Fix issues when deriving from other scriptsGeorge Marques2020-08-261-6/+17
|
* GDScript: Don't fail to load constants if they're not a literalGeorge Marques2020-08-241-5/+1
| | | | | It's still okay as long as it's a constant value. This should already been validated by the analyzer.
* GDScript: Allow "new()" to be called in non-static functionsGeorge Marques2020-07-241-1/+1
|
* Wrap up GDScript 2.0 base implementationGeorge Marques2020-07-221-133/+159
|
* Reintroduce code completionGeorge Marques2020-07-201-4/+5
|
* Add new GDScript type checkerGeorge Marques2020-07-201-3/+7
|
* Add support for propertiesGeorge Marques2020-07-201-27/+259
|
* New GDScript tokenizer and parserGeorge Marques2020-07-201-977/+1495
| | | | | | | | | | 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.
* Merge pull request #38067 from ThakeeNathees/elif-error-line-fixedRémi Verschelde2020-06-171-0/+4
|\ | | | | GDScript debugger incorrect error line fixed
| * GDScript debugger incorrect error line fixedThakee Nathees2020-06-171-0/+4
| | | | | | | | | | if the first line of an else or an elif throws a runtime error the debugger shows incorrect line number.
* | Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-98/+195
| | | | | | | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* | Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* | Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-108/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* | Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-10/+30
| | | | | | | | Part of #33027.
* | Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-21/+42
|/ | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Replace NULL with nullptrlupoDharkael2020-04-021-14/+14
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | EngineDebugger is the new interface to access the debugger. It tries to be as agnostic as possible on the data that various subsystems can expose. It allows 2 types of interactions: - Profilers: A subsystem can register a profiler, assigning it a unique name. That name can be used to activate the profiler or add data to it. The registered profiler can be composed of up to 3 functions: - Toggle: called when the profiler is activated/deactivated. - Add: called whenever data is added to the debugger (via `EngineDebugger::profiler_add_frame_data`) - Tick: called every frame (during idle), receives frame times. - Captures: (Only relevant in remote debugger for now) A subsystem can register a capture, assigning it a unique name. When receiving a message, the remote debugger will check if it starts with `[prefix]:` and call the associated capture with name `prefix`. Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new profiler system. Port SceneDebugger and RemoteDebugger to the new capture system. The LocalDebugger also uses the new profiler system for scripts profiling.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-2/+2
| | | | objects and made them default.
* Keep a weak reference to orphan subclasses to reuse on class reloadChibiDenDen2020-01-151-2/+8
|
* Add fully_qualified_name for GDScript classDani Frank2020-01-141-0/+4
|
* GDScript: Don't re-evaluate index on assigment with operationGeorge Marques2020-01-091-7/+9
| | | | | | | Pass the calculated index from the stack and use the same to get and set the value. This avoids a function with side effects being evaluated twice when using indexing in an assignment with operation statement (e.g. a[function()] += 1).
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* GDScript: Fix type conversion in assignment with operationGeorge Marques2019-12-131-1/+1
|
* Merge pull request #32150 from luzpaz/typosRémi Verschelde2019-09-201-1/+1
|\ | | | | Fix misc. source comment typos
| * Fix misc. source comment typosluz.paz2019-09-191-1/+1
| | | | | | Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
* | GDScript: add an optional message parameter to assert()Mitch Curtis2019-09-111-0/+8
|/ | | | | | | | | | | | | | | | | Before this patch, assert() only took the condition to assert on: assert(item_data) Now, it can optionally take a string that will be printed upon failure: assert(item_data, item_name + " has no item data in ItemDatabase") This makes it easier to immediately see what the issue is by being able to write informative failure messages. Thanks to @wiped1 for sharing their patch, upon which this is based. Closes #17082
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", ↵Robin Hübner2019-08-091-4/+2
| | | | "modules/gdnative", "modules/gdscript" directories.
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-2/+0
|