📜 Add better documentation across the compiler. (#3)

These changes pay particular attention to API endpoints, to try to
ensure that any rustdocs generated are detailed and sensible. A good
next step, eventually, might be to include doctest examples, as well.
For the moment, it's not clear that they would provide a lot of value,
though.

In addition, this does a couple refactors to simplify the code base in
ways that make things clearer or, at least, briefer.
This commit is contained in:
2023-05-13 14:34:48 -05:00
parent f4594bf2cc
commit 1fbfd0c2d2
28 changed files with 1550 additions and 432 deletions

View File

@@ -1,3 +1,17 @@
//! The middle of the compiler: analysis, simplification, optimization.
//!
//! For the moment, this module doesn't do much besides define an intermediate
//! representation for NGR programs that is a little easier to work with then
//! the structures we've built from the actual user syntax. For example, in the
//! IR syntax, function calls are simplified so that all their arguments are
//! either variables or constants, which can make reasoning about programs
//! (and implicit temporary variables) quite a bit easier.
//!
//! For the foreseeable future, this module will likely remain mostly empty
//! besides definitions, as we'll likely want to focus on just processing /
//! validating syntax, and then figuring out how to turn it into Cranelift
//! and object code. After that point, however, this will be the module to
//! come to for analysis and optimization work.
mod ast;
mod eval;
mod from_syntax;