From 70233db4c9045ab522f4572c84463fd7c9008316 Mon Sep 17 00:00:00 2001 From: Julian Murgia Date: Tue, 22 Mar 2016 22:51:21 +0100 Subject: [PATCH] Added list of keywords in GDScript page. Fixes #88 --- reference/gdscript.rst | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/reference/gdscript.rst b/reference/gdscript.rst index 7fb953d4..1fb65529 100644 --- a/reference/gdscript.rst +++ b/reference/gdscript.rst @@ -139,6 +139,64 @@ Keywords The following is the list of keywords supported by the language. Since 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 ~~~~~~~~~