## Summary - Added doc comments across the codebase: `pkg/lambda`, `pkg/saccharine`, `pkg/codec`, `pkg/engine`, `pkg/iterator`, `pkg/set`, `pkg/convert`, `internal/registry`, and `cmd/lambda`. - Made lambda and saccharine expression structs use public fields instead of getters, matching `go/ast` conventions. - Removed superfluous constructors for saccharine and lambda expression/statement types in favor of struct literals. - Consolidated saccharine token constructors into a single `NewToken` function. - Removed the unused `trace` package. ## Test plan - [x] `go build ./...` passes. - [x] `go test ./...` passes. - [ ] Verify `go doc` output renders correctly for documented packages. Reviewed-on: #45 Co-authored-by: M.V. Hutz <git@maximhutz.me> Co-committed-by: M.V. Hutz <git@maximhutz.me>
33 lines
609 B
Go
33 lines
609 B
Go
// Package main defines the 'lambda' command-line interface (CLI).
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func Lambda() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "lambda",
|
|
Short: "Lambda calculus interpreter",
|
|
Long: "A lambda calculus interpreter supporting multiple representations.",
|
|
RunE: func(cmd *cobra.Command, _ []string) error {
|
|
return cmd.Help()
|
|
},
|
|
}
|
|
|
|
cmd.AddCommand(LambdaConvert())
|
|
cmd.AddCommand(LambdaEngine())
|
|
cmd.AddCommand(LambdaReduce())
|
|
|
|
return cmd
|
|
}
|
|
|
|
func main() {
|
|
lambda := Lambda()
|
|
if err := lambda.Execute(); err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|