Skip to content

Priorities

Adam Dernis edited this page May 24, 2020 · 3 revisions

Priorities are the order of operations. Priorities are used to determine if a node belongs higher or lower on the tree (higher is lower).

Their order:

  • Value (0)
  • Unary (1)
  • Power (2)
  • Multiply (3)
  • Add (4)

Value nodes cannot have children, so they must go on the bottom.

Override priority (-1)

The override priority represents a parenthesis. An overriding node is added to the tree right in place, just like a value. However it cannot naturally be escaped when looking for an insertion point. When closing parenthesis, the nearest parenthesis node is set to the active_node.

Clone this wiki locally