semantic-math / math-rules

Manipulate math-ast ASTs based on algebraic rules
MIT License
4 stars 1 forks source link

Handle patterns that aren't completely variable length patterns #20

Closed kevinbarabash closed 7 years ago

kevinbarabash commented 7 years ago

We handle #a_0 * ... but don't handle #a * #b_0 * ...

We'll need to this handle matching patterns like: 5 * x^2 * y using match like so:

matchNode(
  parse('#a * #b_0 * ...'),
  '5 * x^2 * y',
  {
     a: isCoefficient,  // isNumber is probably sufficient
     b: isPolynomialVariable, // match 'x', 'y^2'
  }
)