From a8efe40b577aa8b7bd6be23e182dad183baae559 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 12 Aug 2019 11:53:17 -0700 Subject: [PATCH] Add some documentation for the reduced AST --- schala-lang/language/src/reduced_ast.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schala-lang/language/src/reduced_ast.rs b/schala-lang/language/src/reduced_ast.rs index 03400e2..e102a7a 100644 --- a/schala-lang/language/src/reduced_ast.rs +++ b/schala-lang/language/src/reduced_ast.rs @@ -1,3 +1,17 @@ +//! # Reduced AST +//! The reduced AST is a minimal AST designed to be built from the full AST after all possible +//! static checks have been done. Consequently, the AST reduction phase does very little error +//! checking itself - any errors should ideally be caught either by an earlier phase, or are +//! runtime errors that the evaluator should handle. That said, becuase it does do table lookups +//! that can in principle fail [especially at the moment with most static analysis not yet complete], +//! there is an Expr variant `ReductionError` to handle these cases. +//! +//! A design decision to make - should the ReducedAST types contain all information about +//! type/layout necessary for the evaluator to work? If so, then the evaluator should not +//! have access to the symbol table at all and ReducedAST should carry that information. If not, +//! then ReducedAST shouldn't be duplicating information that can be queried at runtime from the +//! symbol table. But I think the former might make sense since ultimately the bytecode will be +//! built from the ReducedAST. use std::rc::Rc; use crate::ast::*;