TyOverby / Pipe

Mozilla Public License 2.0
21 stars 1 forks source link

Additional stages for math compilation #44

Closed meyerkizner closed 10 years ago

meyerkizner commented 10 years ago

It would be helpful to break up the math compiler into additional stages, in particular a separate preprocessor to handle line joins and an AST walker to check for correct alignment. Currently these functions are handled by the parser, which is somewhat awkward (especially the latter).

TyOverby commented 10 years ago

Right now we don't check for alignment at all. I was thinking of adding a "reader" phase (using lisp terminology) that would do line breaking better, but I think that checking alignment should be handled much as it is now, just in its own phase.

On Jun 6, 2014, at 12:01 AM, meyerkizner notifications@github.com wrote:

It would be helpful to break up the math compiler into additional stages, in particular a separate preprocessor to handle line joins and an AST walker to check for correct alignment. Currently these functions are handled by the parser, which is somewhat awkward (especially the latter).

— Reply to this email directly or view it on GitHub.

meyerkizner commented 10 years ago

Fixed in f44c906. There are certain errors that are only detected in the code generation stage, and we had discussed making that another stage, but as far as I can tell it would require a lot of AST refactoring and generally wouldn't be worth it.