docs: document remaining packages and simplify AST types (#45)
## 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>
This commit was merged in pull request #45.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Package main defines the 'lambda' command-line interface (CLI).
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -9,7 +9,7 @@ func LambdaEngine() *cobra.Command {
|
||||
Use: "engine",
|
||||
Aliases: []string{"eng"},
|
||||
Short: "Information about available engines",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
return cmd.Help()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ func LambdaEngineList() *cobra.Command {
|
||||
Use: "list",
|
||||
Aliases: []string{"ls"},
|
||||
Short: "List available engines",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(*cobra.Command, []string) error {
|
||||
r := GetRegistry()
|
||||
|
||||
for engine := range r.ListEngines() {
|
||||
|
||||
@@ -19,8 +19,8 @@ func GetRegistry() *registry.Registry {
|
||||
(registry.RegisterEngine(r, normalorder.NewProcess, "normalorder", "lambda"))
|
||||
|
||||
// Marshalers
|
||||
(registry.RegisterCodec(r, lambda.Marshaler{}, "lambda"))
|
||||
(registry.RegisterCodec(r, saccharine.Marshaler{}, "saccharine"))
|
||||
(registry.RegisterCodec(r, lambda.Codec{}, "lambda"))
|
||||
(registry.RegisterCodec(r, saccharine.Codec{}, "saccharine"))
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user