Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a code generator for enum boilerplate #401

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions experimental/ast/decl.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ import (
"github.com/bufbuild/protocompile/internal/arena"
)

const (
DeclKindInvalid DeclKind = iota
DeclKindEmpty
DeclKindSyntax
DeclKindPackage
DeclKindImport
DeclKindDef
DeclKindBody
DeclKindRange
)

// DeclKind is a kind of declaration. There is one value of DeclKind for each
// Decl* type in this package.
type DeclKind int8

// DeclAny is any Decl* type in this package.
//
// Values of this type can be obtained by calling an AsAny method on a Decl*
Expand Down
19 changes: 0 additions & 19 deletions experimental/ast/decl_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,6 @@ import (
"github.com/bufbuild/protocompile/internal/arena"
)

const (
DefKindInvalid DefKind = iota
DefKindMessage
DefKindEnum
DefKindService
DefKindExtend
DefKindField
DefKindOneof
DefKindGroup
DefKindEnumValue
DefKindMethod
DefKindOption
)

// DefKind is the kind of definition a [DeclDef] contains.
//
// See [DeclDef.Classify].
type DefKind int8

// DeclDef is a general Protobuf definition.
//
// This [Decl] represents the union of several similar AST nodes, to aid in permissive
Expand Down
346 changes: 346 additions & 0 deletions experimental/ast/enums.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading