Method group

array(Token|array) group(array(string|Token) tokens, void|mapping(string:string) groupings)


Fold sub blocks of an array of tokens into sub arrays, for grouping purposes.

Parameter tokens

The token array to fold.

Parameter groupings

Supplies the tokens marking the boundaries of blocks to fold. The indices of the mapping mark the start of a block, the corresponding values mark where the block ends. The sub arrays will start and end in these tokens. If no groupings mapping is provided, {}, () and [] are used as block boundaries.