Merge pull request #5502 from skyace65/GDScriptTable

Add information on using continue with match to gdscript table
This commit is contained in:
Max Hilbrunner
2022-01-11 17:18:24 +01:00
committed by GitHub

View File

@@ -146,73 +146,73 @@ as listed in the following sections are also reserved.
Keywords are defined in the `GDScript tokenizer <https://github.com/godotengine/godot/blob/master/modules/gdscript/gdscript_tokenizer.cpp>`_
in case you want to take a look under the hood.
+------------+---------------------------------------------------------------------------------------------------------------+
| Keyword | Description |
+============+===============================================================================================================+
| if | See `if/else/elif`_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| elif | See `if/else/elif`_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| else | See `if/else/elif`_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| for | See for_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| while | See while_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| match | See match_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| break | Exits the execution of the current ``for`` or ``while`` loop. |
+------------+---------------------------------------------------------------------------------------------------------------+
| continue | Immediately skips to the next iteration of the ``for`` or ``while`` loop. |
+------------+---------------------------------------------------------------------------------------------------------------+
| pass | Used where a statement is required syntactically but execution of code is undesired, e.g. in empty functions. |
+------------+---------------------------------------------------------------------------------------------------------------+
| return | Returns a value from a function. |
+------------+---------------------------------------------------------------------------------------------------------------+
| class | Defines a class. |
+------------+---------------------------------------------------------------------------------------------------------------+
| class_name | Defines the script as a globally accessible class with the specified name. |
+------------+---------------------------------------------------------------------------------------------------------------+
| extends | Defines what class to extend with the current class. |
+------------+---------------------------------------------------------------------------------------------------------------+
| is | Tests whether a variable extends a given class, or is of a given built-in type. |
+------------+---------------------------------------------------------------------------------------------------------------+
| as | Cast the value to a given type if possible. |
+------------+---------------------------------------------------------------------------------------------------------------+
| self | Refers to current class instance. |
+------------+---------------------------------------------------------------------------------------------------------------+
| signal | Defines a signal. |
+------------+---------------------------------------------------------------------------------------------------------------+
| func | Defines a function. |
+------------+---------------------------------------------------------------------------------------------------------------+
| static | Defines a static function. Static member variables are not allowed. |
+------------+---------------------------------------------------------------------------------------------------------------+
| const | Defines a constant. |
+------------+---------------------------------------------------------------------------------------------------------------+
| enum | Defines an enum. |
+------------+---------------------------------------------------------------------------------------------------------------+
| var | Defines a variable. |
+------------+---------------------------------------------------------------------------------------------------------------+
| breakpoint | Editor helper for debugger breakpoints. |
+------------+---------------------------------------------------------------------------------------------------------------+
| preload | Preloads a class or variable. See `Classes as resources`_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| await | Waits for a signal or a coroutine to finish. See `Awaiting for signals`_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| yield | Previously used for coroutines. Kept as keyword for transition. |
+------------+---------------------------------------------------------------------------------------------------------------+
| assert | Asserts a condition, logs error on failure. Ignored in non-debug builds. See `Assert keyword`_. |
+------------+---------------------------------------------------------------------------------------------------------------+
| void | Used to represent that a function does not return any value. |
+------------+---------------------------------------------------------------------------------------------------------------+
| PI | PI constant. |
+------------+---------------------------------------------------------------------------------------------------------------+
| TAU | TAU constant. |
+------------+---------------------------------------------------------------------------------------------------------------+
| INF | Infinity constant. Used for comparisons and as result of calculations. |
+------------+---------------------------------------------------------------------------------------------------------------+
| NAN | NAN (not a number) constant. Used as impossible result from calculations. |
+------------+---------------------------------------------------------------------------------------------------------------+
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| Keyword | Description |
+============+===================================================================================================================================================+
| if | See `if/else/elif`_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| elif | See `if/else/elif`_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| else | See `if/else/elif`_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| for | See for_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| while | See while_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| match | See match_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| break | Exits the execution of the current ``for`` or ``while`` loop. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| continue | Immediately skips to the next iteration of the ``for`` or ``while`` loop. Stops execution in ``match`` and looks for a match in patterns below it |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| pass | Used where a statement is required syntactically but execution of code is undesired, e.g. in empty functions. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| return | Returns a value from a function. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| class | Defines a class. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| class_name | Defines the script as a globally accessible class with the specified name. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| extends | Defines what class to extend with the current class. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| is | Tests whether a variable extends a given class, or is of a given built-in type. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| as | Cast the value to a given type if possible. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| self | Refers to current class instance. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| signal | Defines a signal. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| func | Defines a function. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| static | Defines a static function. Static member variables are not allowed. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| const | Defines a constant. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| enum | Defines an enum. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| var | Defines a variable. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| breakpoint | Editor helper for debugger breakpoints. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| preload | Preloads a class or variable. See `Classes as resources`_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| await | Waits for a signal or a coroutine to finish. See `Awaiting for signals`_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| yield | Previously used for coroutines. Kept as keyword for transition. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| assert | Asserts a condition, logs error on failure. Ignored in non-debug builds. See `Assert keyword`_. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| void | Used to represent that a function does not return any value. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| PI | PI constant. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| TAU | TAU constant. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| INF | Infinity constant. Used for comparisons and as result of calculations. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| NAN | NAN (not a number) constant. Used as impossible result from calculations. |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
Operators
~~~~~~~~~