styler (version 1.1.1)

relocate_eq_assign_nest: Relocate all assignment expressions that contain EQ_ASSIGN within a nest

Description

Implements the relocation of an EQ_ASSIGN and associated tokens within a nest (nested parse table at one level of nesting). Note that one assignment expression (such as "a = b = c") can include multiple assignment operators, an assignment involves just one assignment operator. For the relocation of assignment expressions that contain EQ_ASSIGN within a nest, we need to first find the expressions that contain = and then split the nest into parse tables each containing one such assignment expression and then relocate each of them separately. We can't do all of them together because:

Usage

relocate_eq_assign_nest(pd)

Arguments

pd

A parse table.

Details

  • An assignment can contain more than just three tokens, e.g. (a <- b <- c).

  • Two assignments can be in the same nest although they don't belong to the same assignment (if-else statement).

Please refer to the section 'Examples' in relocate_eq_assign() for details.