summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gd_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move Variant::evaluate() switch to computed gotoHein-Pieter van Braam2017-09-171-1/+1
| | | | | | | | | | | | | In an effort to make GDScript a little faster replace the double switch() with a computed goto on compilers that set __GNUC__. For compilers that don't support computed goto it will fall back to regular switch/case statements. In addition disable using boolean values in a mathematical context. Now boolean values can only be compared with other booleans. Booleans will also no longer be coerced to integers. This PR replaces #11308 and fixes #11291
* Fix typos 'a' and 'an'Poommetee Ketson2017-09-021-4/+4
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Merge pull request #10581 from hpvb/fix-gcc6+Rémi Verschelde2017-08-251-1/+1
|\ | | | | Make cast_to a static member of Object.
| * Convert Object::cast_to() to the static versionHein-Pieter van Braam2017-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
* | Implemented, The Amazing Zylann Hack (tm), fixes #10603Juan Linietsky2017-08-251-0/+2
|/
* -Code completion for enumerationsJuan Linietsky2017-08-241-1/+17
| | | | -Disabled GDNative and GDNativeScript so build compiles again
* support enums and nested constants in match statementKarroffel2017-08-221-1/+20
| | | | | | | | | | The initial version of the pattern matcher in GDScript does not allow matching on nested identifiers, only one identifiers available in the current scope. With the introduction of enums to GDScript that's a huge missing feature. This commit makes the parser accept indexed constants and variables to properly support enums.
* Removed unnecessary assignmentsWilson E. Alvarez2017-08-211-15/+5
|
* push variable later when created, to avoid self-referencing as a valid case, ↵Juan Linietsky2017-08-081-2/+5
| | | | closes #6111
* Fix $a/b being parsed as divisionBojidar Marinov2017-07-261-1/+2
|
* fix a regression (GDScript) from e00630bKarroffel2017-07-251-1/+1
| | | | | | | | | This removes `not` from the variable safe list of keywords. Before that this was a valid expression: self.!(some_arg) The other fix is just a forgotten boolean negation.
* Make GDScript allow some keywords as identifiersBojidar Marinov2017-07-231-41/+42
| | | | | Fixes #8085 Added some comments around the use of is_token_literal, as discussed.
* Reimplement for..in range() so that it always results in intsBojidar Marinov2017-06-221-2/+2
| | | | Fixes #8278, fixup of bfef8de1bc4f7a7b9617a7b181881129033a0b0e
* GDScript: Use "is" keyword for type checking.Andreas Haas2017-05-271-3/+3
| | | | | | | | | | | | | | | Replaces the `extends` keyword with `is` in the context of testing for type compatibility. `extends` is still used for declaring class inheritance. Example: ```gdscript extends Node2D func _input(ev): if ev is InputEventKey: print("yay, key event") ```
* Fix #8674, and rename a few things for clarityBojidar Marinov2017-05-081-8/+14
|
* Added autocomplete for file paths in the script editormbalint122017-04-181-0/+7
|
* Fixup #8123, seems like I forgot a few thingsBojidar Marinov2017-04-081-3/+3
| | | | | Should close #8315 Please test, I'm still unsure I did it correctly...
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* Fix typo in Parser Error messagecurtisxk382017-04-051-1/+1
|
* Merge pull request #8123 from bojidar-bg/gdscript-inline-block-indentRémi Verschelde2017-03-241-1/+9
|\ | | | | Make inline blocks in GDScript more (or less) pythonic
| * Make inline blocks in GDScript more pythonicBojidar Marinov2017-03-231-1/+9
| | | | | | | | Fixes #8001
* | Fix typos in source code using codespellRémi Verschelde2017-03-241-4/+4
|/ | | | From https://github.com/lucasdemarchi/codespell
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-1388/+1294
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Inf and NaN support added to GDScript.Saracen2017-02-281-0/+16
|
* Merge pull request #7809 from hpvb/fix-6798Rémi Verschelde2017-02-261-4/+25
|\ | | | | Allow preload to accept a const string.
| * Allow preload to accept a const string.Hein-Pieter van Braam2017-02-161-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | In preload() parsing this code will lookup the identifier in the local constant database. If the identifier corresponds to a string constant it is used as the path for preload(). Currently this does not work for global constants, only constants declared in the same class as the preload is happening. We can implement a full fix too. Maybe we can use this PR to discuss the possibilities. This (partially) fixes #6798
* | -begin of export work, not done yetJuan Linietsky2017-02-151-0/+2
|/ | | | -fixes to make scenes exported from godot 2.x work
* Fix parsing bug which causes range(variable) to crash the enginelonesurvivor2017-02-041-4/+3
| | | | | | | problem was a segmentation fault caused by trying to access Vector constants[0] which isn't there if op->arguments.size() is not bigger than one. - the changed OR condition didn't make sense (always true), should be AND - changes the "constant" variable to be false per default and gets set to true when there is actually something pushed to "constants"
* made _ a special token in GDScriptkarroffel2017-01-201-7/+6
|
* Style: Various fixes to play nice with clang-formatRémi Verschelde2017-01-161-1/+1
|
* Style: Cosmetic fixes to play nice with clang-formatRémi Verschelde2017-01-151-2/+2
|
* Compile error when duplicate key in dictionery literal #7034James Mintram2017-01-141-0/+11
|
* Merge pull request #6845 from karroffel/masterJuan Linietsky2017-01-141-0/+576
|\ | | | | Adds pattern matching to GDScript
| * pattern matcher: Implemented backendKarroffel2017-01-111-272/+299
| | | | | | | | changed comments
| * pattern matcher: Implemented transformationsKarroffel2017-01-111-28/+363
| |
| * pattern matching: implemented parserKarroffel2017-01-111-0/+214
| |
* | Merge pull request #4918 from jjay/f/error_on_redefineJuan Linietsky2017-01-141-0/+25
|\ \ | | | | | | Redefine var results in an error
| * | [GDScript] Redefine var results in an errorYakov Borevich2016-05-301-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Error rised if redefine - function argument - for-loop argument - local-scope var Affects #3730
* | | Style: Fix whole-line commented codeRémi Verschelde2017-01-141-2/+2
| | | | | | | | | | | | | | | They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
* | | More efficient iteration syntax, and range() is converted behind the scenes ↵Juan Linietsky2017-01-111-0/+58
| | | | | | | | | | | | to it.
* | | Merge pull request #6930 from bojidar-bg/gdscript-export-array-hintRémi Verschelde2017-01-111-2/+33
|\ \ \ | | | | | | | | Allow typing hints for Array class (in GDScript and Inspector)
| * | | Allow typing hints for Array class (in GDScript and Inspector/ArrayPropertyEdit)Bojidar Marinov2016-10-261-2/+33
| | | | | | | | | | | | | | | | Closes #3586, by implementing the `1b` variation mentioned there.
* | | | Both Array and Dictionary are always in shared mode (removed copy on write).Juan Linietsky2017-01-111-2/+2
| | | |
* | | | It is now possible to name layers of different kinds!Juan Linietsky2017-01-101-1/+1
| | | |
* | | | Fix code completion for new getnode syntaxJuan Linietsky2017-01-081-4/+10
| | | |
* | | | -Fix bugs related to PoolVector crashesJuan Linietsky2017-01-081-0/+86
| | | | | | | | | | | | | | | | -Added ability to request nodes using $Name in GDScript :)
* | | | ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky2017-01-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Variant. All usages of "type" to refer to classes were renamed to "class" ClassDB has been exposed to GDScript. OBJ_TYPE() macro is now GDCLASS()
* | | | Revert expression reduction from #7390Rémi Verschelde2017-01-021-1/+1
| | | | | | | | | | | | | | | | Fixes #7412.
* | | | Merge pull request #7390 from bojidar-bg/gdscript-assign-errorRémi Verschelde2017-01-021-1/+10
|\ \ \ \ | | | | | | | | | | Disallow assignment to constants and expressions