TyOverby / Pipe

Mozilla Public License 2.0
21 stars 1 forks source link

Reduce the API to a few functions, and document them #27

Closed meyerkizner closed 10 years ago

meyerkizner commented 10 years ago

What's the purpose of EquationBlock.processAlign (in MathBlocks.scala)? This usage of the math parser is stopping me from making all math parser accesses through the API.

TyOverby commented 10 years ago

It is used for aligning equations inside an equation block.

|equation !=
    a != 2
    b != 3

The != sign would be parsed into the AST Chunk("!="). Then because we have the AST of the symbol to align on, and the ASTs of the actual equations, we can do an AST traversal to generate the ASTs [Symbol("a"), Align(Symbol("!=")), Symbol("2")] and so on.

We might want to extend the API to allow AST access for this, or have it built into the math section hidden behind the API because this is the way to do alignment because it can capture nodes that would otherwise be hella edge-casey.