Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tutorials/scripting/gdscript/gdscript_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,10 @@ you can specify a pattern guard after the list of patterns with the ``when`` key
print("Point on line y = -x")
[var x, var y]:
print("Point (%s, %s)" % [x, y])
_ when point > 0:
print("Point greater than 0")
_ when point > 1:
print("This wouldn't execute because of the pattern guard above")

- If there is no matching pattern for the current branch, the pattern guard
is **not** evaluated and the patterns of the next branch are checked.
Expand Down
Loading