summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_tokenizer.cpp
AgeCommit message (Collapse)Author
2020-07-22Wrap up GDScript 2.0 base implementationGeorge Marques
2020-07-20Reintroduce code completionGeorge Marques
2020-07-20Fix comments in beginning of fileGeorge Marques
Also improve error for unknown characters.
2020-07-20New GDScript tokenizer and parserGeorge Marques
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.
2020-06-03Rename String bin_to_int64 to bin_to_intAaron Franke
And also change String static to_int(const char *) to return int64_t
2020-06-03Remove 32-bit String hex_to_int methodAaron Franke
2020-06-03Remove 32-bit String to_int methodAaron Franke
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
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.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-05-10Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde
Part of #33027.
2020-05-09Merge pull request #37033 from ThakeeNathees/python-like-str-escapeRémi Verschelde
python like string escape implemented
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-15python like string escape implementedThakee Nathees
2020-02-25Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky
- 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.
2020-02-23Merge pull request #36461 from akien-mga/c++17-fallthrough-attributeRémi Verschelde
Replace FALLTHROUGH macro by C++17 [[fallthrough]]
2020-02-23Replace FALLTHROUGH macro by C++17 [[fallthrough]]Rémi Verschelde
This attribute is now part of the standard we target so we no longer need compiler-specific hacks. Also enables -Wimplicit-fallthrough for Clang now that we can properly support it. It's already on by default for GCC's -Wextra. Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-22Add support for Vector2i, Rect2i and Vector3i to VariantJuan Linietsky
WARNING: Requires C++17 'guaranteed copy elision' to fix ambiguous operator problems in Variant. This was added for this commit (and future C++17 uses) in #36457.
2020-02-21Added StringName as a variant type.Juan Linietsky
Also changed all relevant properties defined manually to StringName.
2020-02-20Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky
objects and made them default.
2020-02-18PoolVector is gone, replaced by VectorJuan Linietsky
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
2020-02-13Remove more deprecated methods and codeRémi Verschelde
2020-02-13Remove deprecated sync and slave networking keywordsRémi Verschelde
Those keywords were deprecated for 3.1 in #22087. Also fix token name for `TK_REMOTE`, should be "remote" like the keyword.
2020-01-01Update copyright statements to 2020Rémi Verschelde
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.
2019-11-12Merge pull request #32966 from ffaristocrat/fix-hex-parsingRémi Verschelde
Fix base 16 hex literal parsing
2019-11-12Fixes #32963 by correctly parsing bin/hex literalsMicheál Keane
2019-10-25Merge pull request #32808 from bojidar-bg/30937-less-strict-mixed-spacingRémi Verschelde
Allow mixed tabs and spaces when indentation does not depend on tab size
2019-10-25Allow mixed tabs and spaces when indentation does not depend on tab sizeBojidar Marinov
(hopefully) Closes #30937, fixes #32612
2019-10-18Remove duplicate valid value check in gdscript_tokenizer.cpp.Marcel Admiraal
2019-09-25Added some obvious errors explanationsqarmin
2019-08-09Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", ↵Robin Hübner
"modules/gdnative", "modules/gdscript" directories.
2019-07-26Disallow using of both tabs and spaces for indentation in the same fileBojidar Marinov
Closes #7898
2019-06-26Some code changed with Clang-Tidyqarmin
2019-04-25Support for binary literals in GDScript. Added an error that shows if a ↵jude-lafitteIII
point is written in a hex literal. Added highlighting for binary literals in GDScript
2019-04-22Merge pull request #27673 from qarmin/small_fixesRémi Verschelde
Small fixes, mostly duplicated code
2019-04-10Merge pull request #27170 from ↵Rémi Verschelde
timoschwarzer/allow-whitespaces-in-warning-ignore-comments Allow whitespaces in warning-ignore comments
2019-04-09Style: Apply new changes from clang-format 8.0Rémi Verschelde
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
2019-04-08Small fixes, mostly dupicated codeqarmin
2019-04-05Fix -Wimplicit-fallthrough warnings from GCC 8Rémi Verschelde
Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional. Can be replaced by `[[fallthrough]]` if/when we switch to C++17. The warning is now enabled by default for GCC on `extra` warnings level (part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet, but we could enable it manually once we switch to C++11. There's no equivalent feature in MSVC for now. Fixes #26135.
2019-04-01Add object encoding param to serialization methodsFabio Alessandrelli
Network peers get_var/put_var File get_var/store_var GDScript/Mono/VisualScript bytes2var/var2bytes Add MultiplayerAPI.allow_object_decoding member which deprecates PacketPeer.allow_object_decoding. Break ABI compatibaility (API compatibility for GDNative).
2019-03-17Allow whitespaces in warning-ignore commentsTimo Schwarzer
2019-02-27Fix -Wsign-compare warnings.marxin
I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
2019-02-21Fix all -Wtype-limits warnings.marxin
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-02-20GDScript: Remove unused `switch`, `case` and `do` CF keywordsRémi Verschelde
They had been reserved for future implementation, but we now have the `match` CF keyword which does the same and more. According to @reduz `do` was even added by mistake when copying from the shader language parser, it was never intended to add support for `do`... `while` loops, as the syntax would be awkward in GDScript, and the added sugar is not worth it. Fixes #25787.
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-10-14GDScriptTokenizer: Fix token_names orderlupoDharkael
2018-09-15Rename slave keyword to puppetFabio Alessandrelli
The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-08-24Make some debug prints verbose-only, remove othersRémi Verschelde