style: moved functions around
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user