syntaxToEdition function

int syntaxToEdition(
  1. String syntax
)

Maps the legacy syntax keyword to its edition sentinel.

An empty or "proto2" syntax is proto2; "proto3" is proto3. Used by the legacy-inference path so proto2/proto3 descriptors resolve through the same edition-defaults table as editions files.

Implementation

int syntaxToEdition(String syntax) {
  if (syntax == 'proto3') return editionProto3;
  return editionProto2;
}