| 1 | = Pass = |
| 2 | |
| 3 | Do nothing successfully. |
| 4 | |
| 5 | Used as a placeholder or for null operation where code is expected (like in a block) |
| 6 | but nothing needs to be done. |
| 7 | |
| 8 | == Grammar == |
| 9 | {{{ |
| 10 | pass |
| 11 | }}} |
| 12 | |
| 13 | == Examples == |
| 14 | {{{ |
| 15 | def methodNeededForInterface # but not used |
| 16 | pass |
| 17 | |
| 18 | # simplify complicated code flow. |
| 19 | if .complicatedExpression0 |
| 20 | if .expression1 and .expression2 and not .expression3 or expression4 |
| 21 | pass # all is well |
| 22 | else if expression1 and not expression2 |
| 23 | .expressFailure |
| 24 | else if .expression3 |
| 25 | .expressFailure2 |
| 26 | # ... |
| 27 | |
| 28 | |
| 29 | # property with both getter and setter, setter must be available but does nothing |
| 30 | pro isUsed as bool |
| 31 | get |
| 32 | return false |
| 33 | set |
| 34 | pass |
| 35 | |
| 36 | try |
| 37 | .doOperation |
| 38 | catch FormatException |
| 39 | pass # trap and discard the exception |
| 40 | |
| 41 | }}} |
| 42 | |
| 43 | |
| 44 | |
| 45 | == Notes == |