matches

abstract fun matches(expr: IExpression, map: Map<HashString, ITreeNode<out Any>>): Boolean(source)

Tries to match this expression with expr. The matching rules are: (i) a variable matches everything; (ii) a constant value matches an identical constant value; (iii) a number matches an identical number or an operator, (iv) operators match everything but constants, (v) comparators match numbers and operators (verifying the values); (vi) expr type can't be comparator; (vii) add and rem operators work only with lists.

Return

true if this expression can "match" with expr.

Parameters

expr

the expression to match

map

the matches map