Documentation
¶
Overview ¶
Package syntax specifies all of the syntax pragmas (including editions) that Protocompile understands.
Index ¶
- Constants
- func All() iter.Seq[Syntax]
- func Editions() iter.Seq[Syntax]
- type Syntax
- func (s Syntax) DescriptorName() string
- func (v Syntax) GoString() string
- func (s Syntax) IsConstraint() bool
- func (s Syntax) IsEdition() bool
- func (s Syntax) IsKnown() bool
- func (s Syntax) IsSupported() bool
- func (s Syntax) IsValid() bool
- func (s Syntax) Name() string
- func (v Syntax) String() string
Constants ¶
const LatestImplementedEdition = Edition2024
LatestImplementedEdition is the most recent edition that the compiler implements.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Syntax ¶
type Syntax int32
Syntax is a known syntax pragma.
Not only does this include "proto2" and "proto3", but also all of the editions.
The integer values of the constants correspond to their the values of google.protobuf.Edition.
const ( Unknown Syntax = 0 Proto2 Syntax = 998 Proto3 Syntax = 999 Edition2023 Syntax = 1000 Edition2024 Syntax = 1001 EditionLegacy Syntax = 900 EditionTest1 Syntax = 1 EditionTest2 Syntax = 2 EditionTest99997 Syntax = 99997 EditionTest99998 Syntax = 99998 EditionTest99999 Syntax = 99999 EditionMax Syntax = 0x7fff_ffff )
func Lookup ¶
Lookup looks up a syntax pragma by name.
If name does not name a known pragma, returns Unknown.
func (Syntax) DescriptorName ¶
DescriptorName converts a syntax into the corresponding google.protobuf.Edition name.
Returns a stringified digit if it is not a named edition value.
func (Syntax) IsConstraint ¶
IsConstraint returns whether this syntax can be used as a constraint in google.protobuf.FieldOptions.feature_support.
func (Syntax) IsKnown ¶
IsKnown returns whether this syntax is a known value in google.protobuf.Edition.
func (Syntax) IsSupported ¶
IsSupported returns whether this syntax is fully supported.
func (Syntax) IsValid ¶
IsValid returns whether this syntax is valid (i.e., it can appear in a syntax/edition declaration).