edition library

Protobuf Edition identifiers and string/syntax mapping.

Editions are represented by their numeric google.protobuf.Edition value (time-ordered), so feature resolution can compare editions with </>=. This module is Ball-portable: top-level integer constants + plain functions, no dart: dependencies, so it encodes into the ball_protobuf module and runs on every target engine.

References:

Constants

edition2023 → const int
Edition 2023 — the first real edition.
edition2024 → const int
Edition 2024.
edition2026 → const int
Edition 2026 (declared in descriptor.proto; not a published edition yet).
editionLegacy → const int
Pre-editions legacy floor. proto2 and proto3 resolve through edition entries at or below their sentinel value.
editionMax → const int
Maximum representable edition.
editionProto2 → const int
Internal sentinel for proto2 syntax (never appears in a file edition =).
editionProto3 → const int
Internal sentinel for proto3 syntax (never appears in a file edition =).
editionUnknown → const int
Unknown / unset edition.
editionUnstable → const int
Test-only sentinel above every released edition.

Functions

editionFromString(String s) int
Parses an edition declaration or syntax string into its numeric value.
editionToName(int edition) String
Returns the canonical EDITION_* enum name for a numeric edition (the form used by proto3-JSON and protoc --decode). Returns "EDITION_UNKNOWN" for unrecognized values.
syntaxToEdition(String syntax) int
Maps the legacy syntax keyword to its edition sentinel.