Browse Source

Add Format String to operator/precedence list

zacryol 3 years ago
parent
commit
ee599ec18a
1 changed files with 53 additions and 51 deletions
  1. 53 51
      getting_started/scripting/gdscript/gdscript_basics.rst

+ 53 - 51
getting_started/scripting/gdscript/gdscript_basics.rst

@@ -226,57 +226,59 @@ Operators
 
 
 The following is the list of supported operators and their precedence.
 The following is the list of supported operators and their precedence.
 
 
-+---------------------------------------------------------------+-----------------------------------------+
-| **Operator**                                                  | **Description**                         |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``x[index]``                                                  | Subscription (highest priority)         |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``x.attribute``                                               | Attribute reference                     |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``foo()``                                                     | Function call                           |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``is``                                                        | Instance type checker                   |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``~``                                                         | Bitwise NOT                             |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``-x``                                                        | Negative / Unary negation               |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``*`` ``/`` ``%``                                             | Multiplication / Division / Remainder   |
-|                                                               |                                         |
-|                                                               | These operators have the same behavior  |
-|                                                               | as C++. Integer division is truncated   |
-|                                                               | rather than returning a fractional      |
-|                                                               | number, and the % operator is only      |
-|                                                               | available for ints ("fmod" for floats)  |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``+``                                                         | Addition / Concatenation of arrays      |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``-``                                                         | Subtraction                             |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``<<`` ``>>``                                                 | Bit shifting                            |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``&``                                                         | Bitwise AND                             |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``^``                                                         | Bitwise XOR                             |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``|``                                                         | Bitwise OR                              |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``<`` ``>`` ``==`` ``!=`` ``>=`` ``<=``                       | Comparisons                             |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``in``                                                        | Content test                            |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``!`` ``not``                                                 | Boolean NOT                             |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``and`` ``&&``                                                | Boolean AND                             |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``or`` ``||``                                                 | Boolean OR                              |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``if x else``                                                 | Ternary if/else                         |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``as``                                                        | Type casting                            |
-+---------------------------------------------------------------+-----------------------------------------+
-| ``=`` ``+=`` ``-=`` ``*=`` ``/=`` ``%=`` ``&=`` ``|=``        | Assignment (lowest priority)            |
-+---------------------------------------------------------------+-----------------------------------------+
++------------------------------------------------------------------------+-----------------------------------------+
+| **Operator**                                                           | **Description**                         |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``x[index]``                                                           | Subscription (highest priority)         |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``x.attribute``                                                        | Attribute reference                     |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``foo()``                                                              | Function call                           |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``is``                                                                 | Instance type checker                   |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``~``                                                                  | Bitwise NOT                             |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``-x``                                                                 | Negative / Unary negation               |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``*`` ``/`` ``%``                                                      | Multiplication / Division / Remainder   |
+|                                                                        |                                         |
+|                                                                        | These operators have the same behavior  |
+|                                                                        | as C++. Integer division is truncated   |
+|                                                                        | rather than returning a fractional      |
+|                                                                        | number, and the % operator is only      |
+|                                                                        | available for ints ("fmod" for floats), |
+|                                                                        | and is additionally used for Format     |
+|                                                                        | Strings                                 |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``+``                                                                  | Addition / Concatenation of arrays      |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``-``                                                                  | Subtraction                             |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``<<`` ``>>``                                                          | Bit shifting                            |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``&``                                                                  | Bitwise AND                             |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``^``                                                                  | Bitwise XOR                             |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``|``                                                                  | Bitwise OR                              |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``<`` ``>`` ``==`` ``!=`` ``>=`` ``<=``                                | Comparisons                             |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``in``                                                                 | Content test                            |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``!`` ``not``                                                          | Boolean NOT                             |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``and`` ``&&``                                                         | Boolean AND                             |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``or`` ``||``                                                          | Boolean OR                              |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``if x else``                                                          | Ternary if/else                         |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``as``                                                                 | Type casting                            |
++------------------------------------------------------------------------+-----------------------------------------+
+| ``=`` ``+=`` ``-=`` ``*=`` ``/=`` ``%=`` ``&=`` ``|=`` ``<<=`` ``>>=`` | Assignment (lowest priority)            |
++------------------------------------------------------------------------+-----------------------------------------+
 
 
 Literals
 Literals
 ~~~~~~~~
 ~~~~~~~~