finesse.script.util.scriptsorted

finesse.script.util.scriptsorted(items, reverse=False)[source]

Sort container items by their script position.

Parameters
itemssequence of TokenContainer

The container items to sort.

reversebool, optional

Request the result in descending instead of ascending order.

Returns
list of TokenContainer

Container items sorted by line number then column.