23 lines
941 B
Plaintext
23 lines
941 B
Plaintext
'''Inverted syntax with conditional expressions'''
|
|
|
|
In traditional syntax conditional expressions are usually shown before the action within a statement or code block:
|
|
|
|
<syntaxhighlight lang="pseudocode"> IF raining=true THEN needumbrella=true </syntaxhighlight>
|
|
|
|
In inverted syntax, the action is listed before the conditional expression in the statement or code block:
|
|
|
|
<syntaxhighlight lang="pseudocode"> needumbrella=true IF raining=true </syntaxhighlight>
|
|
|
|
'''Inverted syntax with assignment'''
|
|
|
|
In traditional syntax, assignments are usually expressed with the variable appearing before the expression:
|
|
|
|
<syntaxhighlight lang="pseudocode"> a = 6</syntaxhighlight>
|
|
|
|
In inverted syntax, the expression appears before the variable:
|
|
<syntaxhighlight lang="pseudocode"> 6 = a</syntaxhighlight>
|
|
|
|
'''Task'''
|
|
|
|
The task is to demonstrate support for inverted syntax forms within the language by showing both the traditional and inverted forms.
|