style: moved functions around

This commit is contained in:
2025-12-30 15:58:14 -05:00
parent 412d3924eb
commit 2499921679
10 changed files with 115 additions and 93 deletions

View File

@@ -28,19 +28,14 @@ func main() {
input, err := options.Source.Extract()
cli.HandleError(err)
// Parse tokens.
tokens, err := saccharine.GetTokens(input)
// Parse code into syntax tree.
ast, err := saccharine.Parse(input)
cli.HandleError(err)
logger.Info("parsed tokens", "tokens", tokens)
// Turn tokens into syntax tree.
expression, err := saccharine.Parse(tokens)
cli.HandleError(err)
logger.Info("parsed syntax tree", "tree", saccharine.Stringify(expression))
logger.Info("parsed syntax tree", "tree", ast)
// Compile expression to lambda calculus.
compiled := convert.SaccharineToLambda(expression)
logger.Info("compiled lambda expression", "tree", lambda.Stringify(compiled))
compiled := convert.SaccharineToLambda(ast)
logger.Info("compiled λ expression", "tree", lambda.Stringify(compiled))
// Create reduction engine.
process := engine.New(options, &compiled)