Added list of keywords in GDScript page. Fixes #88

This commit is contained in:
Julian Murgia 2016-03-22 22:51:21 +01:00
parent 4ce63e839b
commit 70233db4c9
1 changed files with 58 additions and 0 deletions

View File

@ -139,6 +139,64 @@ Keywords
The following is the list of keywords supported by the language. Since The following is the list of keywords supported by the language. Since
keywords are reserved words (tokens), they can't be used as identifiers. keywords are reserved words (tokens), they can't be used as identifiers.
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Keyword | Description |
+================+==========================================================================================================================================================================================================+
| if | See if-else-elif_ |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| elif | See if-else-elif_ |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| else | See if-else-elif_ |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| for | See for_ |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| do | Reserved for future implementation of do...while loops. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| while | See while_ |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| switch | Reserved for future implementation. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| case | Reserved for future implementation. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| break | Exits the execution of the current for or while loop |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| continue | Directly continues with the next iteration of the for or while loop |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| pass | Used when a statement is required syntactically but you do not want any command or code to execute (ex: empty function returning nothing) |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| return | Returns a value at the end of the function |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| func | Defines a function |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| class | Defines a class |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| extends | Indicates that the script extends another script or class. Also used to test whether a variable extends a class (if variable extends MyClass:) |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| onready | Initializes a script variable when the Node which the script it attached to and all its children, are ready. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tool | Executes the script in the editor |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| static | Defines a static function. Static members are not allowed. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| export | Saves a variable along a scene. If initialized, can be set from the editor. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setget | Defines setter and getter functions for a variable. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| const | Defines a constant variable. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| var | Defines a variable. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| preload | Preloads a resource or a scene. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| assert | Reserved for future GDScript implementation. Stops if the provided condition is not valid. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| yield / resume | Coroutines : yield freezes the state of execution of the current function and returns back to where it was called from. On resume, the function will continue execution from the place yield was called. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| signal | Creates a signal. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| breakpoint | Editor helper for debugger breakpoints. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Operators Operators
~~~~~~~~~ ~~~~~~~~~