Assignment ::= Ident ":=" Expression | Connection ":=" Expression
The left part of an assignment (referred to as the LValue) can be an identifier or connection expression. The first case characterizes a situation where a variable (global or local to a procedure) receives a value, while the second one characterizes a case where the statement attaches a value to a non-terminal as an annotation.
When the lvalue is a single identifier, the following applies:
The rules that dictate the assignment of annotation are described extensively when describing annotation.
RainCode performs no type checking with regard to the previous value of the variable. A string value can be assigned to a variable that previously denoted an integer value. Similarly, when using the assignment to annotate a non-terminal, there is no restriction regarding the type of the previous value of the annotation if any.