summaryrefslogtreecommitdiffstats
path: root/core/math/expression.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@c6c464cf9ae56e8b68620af65125dd980d0e8122Spartan3222024-11-021-1/+1
|\
| * [Core] Improve error messages with `vformat`A Thousand Ships2024-10-301-1/+1
| |
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Fix parsing of `4.` in ExpressionHaoyu Qiu2024-07-021-7/+3
|
* Add const lvalue ref to core/* container parametersMuller-Castro2024-02-141-1/+1
|
* Add support for Unicode identifiers in Expression classGeorge Marques2023-01-211-5/+4
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Fix periods in editor strings and messagesHugo Locurcio2022-11-141-1/+1
| | | | | | - Ensure all strings with ellipsis end with 3 periods instead of 2. - Fix extraneous period in "Error calling from signal '...' to callable" messages.
* Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg2022-10-071-27/+27
| | | | change warnings=all to use /W4.
* Expression built-in functions can also be considered as identifiers in ↵cdemirer2022-07-041-1/+1
| | | | subscripts
* Add a const call mode to Object, Variant and Script.K. S. Ernest (iFire) Lee2022-06-271-17/+21
| | | | | | | For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script). This mode ensures only const functions can be called, making it safe to use from the editor. Co-Authored-By: reduz <reduzio@gmail.com>
* i18n: Misc fixes translation stringsRémi Verschelde2022-06-081-1/+1
| | | | Adds some translator comments to solve some questions raised on Weblate.
* Implement exponential operator (**) to GDScript/ExpressionsYuri Roubinsky2022-05-111-14/+26
|
* Remove VARIANT_ARG* macrosreduz2022-03-091-1/+1
| | | | | | | | * Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
* Merge pull request #57620 from Haydoggo/expression-exp-fixRémi Verschelde2022-02-051-3/+1
|\ | | | | Fix Expression's parsing of positive exponent literals
| * Make parser treat all exponent literals as floatHayden2022-02-051-3/+1
| |
* | Cleanup and move char functions to the `char_utils.h` header.bruvzg2022-02-041-24/+12
|/
* Added hex and bin literal support to Expression parserHayden Leete2022-02-041-4/+44
| | | | fixed formatting
* Add support for the escaped UTF-16 and UTF-32 Unicode characters in the ↵bruvzg2022-01-301-3/+40
| | | | scripts and expressions.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Merge pull request #47294 from sebastian-heinz/patch-1Rémi Verschelde2021-12-021-0/+8
|\
| * allow variant construction in expressionssebastian-heinz2021-12-021-0/+8
| |
* | Rename `remove()` to `remove_at()` when removing by indexLightning_A2021-11-231-3/+3
| |
* | Use the standard C `INFINITY` and `NAN` constants directlyHugo Locurcio2021-07-211-2/+2
| | | | | | | | | | | | | | The `Math_INF` and `Math_NAN` defines were just aliases for those constants, so we might as well use them directly. Some portions of the code were already using `INFINITY` directly.
* | Rename Reference to RefCountedPedro J. Estébanez2021-06-111-1/+1
|/
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-1/+1
|
* 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 🎆
* Static analyzer fixes:bruvzg2020-12-091-27/+0
| | | | | | Removes unused code in OS. Fixes return types. Fixes few typos.
* Refactor variant built-in methods yet again.reduz2020-11-111-5/+5
| | | | | | * Using C-style function pointers now, InternalMethod is gone. * This ensures much better performance in typed code. * Renamed builtin_funcs to utility_funcs, to avoid naming confusion
* Create Variant built-in functions.reduz2020-11-101-700/+13
| | | | | | | -Moved Expression to use this, removed its own. -Eventually GDScript/VisualScript/GDNative need to be moved to this. -Given the JSON functions were hacked-in, removed them and created a new JSONParser class -Made sure these functions appear properly in documentation, since they will be removed from GDScript
* Refactored variant constructor logicreduz2020-11-091-2/+2
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-30/+3
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Refactored variant setters/gettersreduz2020-11-071-1/+1
| | | | | | -Discern between named, indexed and keyed -Get direct access to functions for typed GDScript and GDNative bindings -Small changes to some classes in order to work with the new setget binder
* Exposed randi_range to global funcs + renamed rand_range to randf_rangeYuri Roubinsky2020-11-061-5/+12
|
* [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-031-10/+10
|
* Make all String float conversion methods be 64-bitAaron Franke2020-07-271-1/+1
|
* Merge pull request #38713 from aaronfranke/string-64bitRémi Verschelde2020-07-011-1/+1
|\ | | | | Make all String integer conversion methods be 64-bit
| * Remove 32-bit String to_int methodAaron Franke2020-06-031-1/+1
| |
* | Fix for Expression class: inner string can be single quotedntfs.hard2020-06-021-1/+3
|/
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-24/+24
| | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-31/+61
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-158/+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.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-11/+0
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-45/+135
| | | | Part of #33027.
* Replace NULL with nullptrlupoDharkael2020-04-021-39/+39
|
* Fix out of bound array access caused by unassigned variableRafał Mikrut2020-04-011-0/+2
|
* Fix various typosluz.paz2020-03-111-1/+1
| | | Found via `codespell`
* Merge pull request #36515 from reduz/packed-array-64-bitsRémi Verschelde2020-02-251-5/+5
|\ | | | | Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
| * Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.