From 6e2425bfc5ad9bfac68289a9dcc2cccee1441fd9 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 21 Mar 2026 22:03:32 +0000 Subject: Switch to protobuf3 --- protobuf/patio.proto | 151 +------------------------------------------------ protobuf/sources.proto | 11 +--- 2 files changed, 2 insertions(+), 160 deletions(-) diff --git a/protobuf/patio.proto b/protobuf/patio.proto index fb00d37a..40d3a958 100644 --- a/protobuf/patio.proto +++ b/protobuf/patio.proto @@ -1,20 +1,15 @@ -edition = "2024"; -import "google/protobuf/java_features.proto"; +syntax = "proto3"; import "sources.proto"; option java_package = "org.shedlang.compiler.patio.protobuf"; option java_outer_classname = "PatioProtobuf"; message PatioCompilationUnit { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; repeated PatioCompilationUnitElement elements = 2; } message PatioCompilationUnitElement { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioDataElementImmutableDefinition data_element_immutable_definition = 1; PatioDataElementMutableDeclaration data_element_mutable_declaration = 2; @@ -26,8 +21,6 @@ message PatioCompilationUnitElement { } message PatioDataElementImmutableDefinition { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string name = 2; PatioVisibility visibility = 3; @@ -35,16 +28,12 @@ message PatioDataElementImmutableDefinition { } message PatioDataElementMutableDeclaration { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string name = 2; PatioDataLayout layout = 3; } message PatioDataElementMutableDefinition { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string name = 2; PatioVisibility visibility = 3; @@ -52,16 +41,12 @@ message PatioDataElementMutableDefinition { } message PatioExceptionTypeDefinition { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string name = 2; PatioType value_type = 3; } message PatioFunctionDeclaration { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string name = 2; repeated PatioLocal params = 3; @@ -69,8 +54,6 @@ message PatioFunctionDeclaration { } message PatioFunctionDefinition { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string name = 2; PatioVisibility visibility = 3; @@ -82,16 +65,12 @@ message PatioFunctionDefinition { // == Locals == message PatioLocal { - option features.(pb.java).nest_in_file_class = YES; - string name = 1; PatioType type = 2; PatioLocalType local_type = 3; } enum PatioLocalType { - option features.(pb.java).nest_in_file_class = YES; - PARAM = 0; VAL = 1; VAR = 2; @@ -100,8 +79,6 @@ enum PatioLocalType { // == Visibility == enum PatioVisibility { - option features.(pb.java).nest_in_file_class = YES; - PRIVATE = 0; PUBLIC = 1; } @@ -109,8 +86,6 @@ enum PatioVisibility { // == Instructions == message PatioInstruction { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioBlock block = 1; PatioBoolToInt bool_to_int = 2; @@ -143,24 +118,18 @@ message PatioInstruction { } message PatioBlock { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; repeated PatioInstruction body = 2; repeated PatioOperand results = 3; } message PatioBoolToInt { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand value = 3; } message PatioCall { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; string function_name = 3; @@ -168,8 +137,6 @@ message PatioCall { } message PatioCallPointer { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand function_pointer = 3; @@ -177,16 +144,12 @@ message PatioCallPointer { } message PatioDataPtrToInt { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand value = 3; } message PatioIf { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; repeated PatioLocalRef destinations = 2; PatioOperand condition = 3; @@ -195,8 +158,6 @@ message PatioIf { } message PatioIntAdd { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand left = 3; @@ -204,8 +165,6 @@ message PatioIntAdd { } message PatioIntEquals { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand left = 3; @@ -213,8 +172,6 @@ message PatioIntEquals { } message PatioIntNotEqual { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand left = 3; @@ -222,8 +179,6 @@ message PatioIntNotEqual { } message PatioIntSub { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand left = 3; @@ -231,51 +186,37 @@ message PatioIntSub { } message PatioIntToBool { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand value = 3; } message PatioIntToDataPtr { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand value = 3; } message PatioLocalStore { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand value = 3; } message PatioLoop { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; repeated PatioInstruction body = 2; } message PatioLoopBreak { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; } message PatioLoopContinue { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; } message PatioMemoryLoad { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioOperand pointer = 3; @@ -284,8 +225,6 @@ message PatioMemoryLoad { } message PatioMemoryStore { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioOperand pointer = 2; PatioDataLayout layout = 3; @@ -294,28 +233,20 @@ message PatioMemoryStore { } message PatioResume { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioOperand value = 2; } message PatioReturn { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioOperand value = 2; } message PatioReturnVoid { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; } message PatioSwitch { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; repeated PatioLocalRef destinations = 2; PatioOperand value = 3; @@ -324,24 +255,18 @@ message PatioSwitch { } message PatioSwitchCase { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; uint32 value = 2; PatioBlock body = 3; } message PatioThrow { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string exception_type_name = 2; PatioOperand value = 3; } message PatioTry { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; repeated PatioLocalRef destinations = 2; repeated PatioCatchClause catch_clauses = 3; @@ -349,8 +274,6 @@ message PatioTry { } message PatioCatchClause { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; string exception_type_name = 2; PatioLocalRef destination = 3; @@ -358,22 +281,16 @@ message PatioCatchClause { } message PatioUnreachable { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; } message PatioVarLoad { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef destination = 2; PatioLocalRef var = 3; } message PatioVarStore { - option features.(pb.java).nest_in_file_class = YES; - Source source = 1; PatioLocalRef var = 2; PatioOperand value = 3; @@ -382,8 +299,6 @@ message PatioVarStore { // == Operands == message PatioOperand { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioBoolConst bool_const = 1; PatioByteConst byte_const = 2; @@ -396,52 +311,36 @@ message PatioOperand { } message PatioBoolConst { - option features.(pb.java).nest_in_file_class = YES; - bool value = 1; } message PatioByteConst { - option features.(pb.java).nest_in_file_class = YES; - uint32 value = 1; } message PatioDataPtrConst { - option features.(pb.java).nest_in_file_class = YES; - PatioDataPtrValue value = 1; } message PatioFunctionPtrConst { - option features.(pb.java).nest_in_file_class = YES; - string name = 1; } message PatioIntConst { - option features.(pb.java).nest_in_file_class = YES; - PatioIntValue value = 1; } message PatioInt32Const { - option features.(pb.java).nest_in_file_class = YES; - PatioIntValue value = 1; } message PatioLocalRef { - option features.(pb.java).nest_in_file_class = YES; - string name = 1; } // == Data ptr values == message PatioDataPtrValue { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioDataPtrValueDataElement data_element = 1; PatioDataPtrValueNull null = 2; @@ -449,20 +348,15 @@ message PatioDataPtrValue { } message PatioDataPtrValueDataElement { - option features.(pb.java).nest_in_file_class = YES; - string name = 1; } message PatioDataPtrValueNull { - option features.(pb.java).nest_in_file_class = YES; } // == Int values == message PatioIntValue { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioIntValueByteOffsetOf byte_offset_of = 1; PatioIntValueByteSizeOf byte_size_of = 2; @@ -471,29 +365,21 @@ message PatioIntValue { } message PatioIntValueByteOffsetOf { - option features.(pb.java).nest_in_file_class = YES; - PatioDataLayout layout = 1; repeated uint32 offset = 2; } message PatioIntValueByteSizeOf { - option features.(pb.java).nest_in_file_class = YES; - PatioDataLayout layout = 1; } message PatioIntValueLiteral { - option features.(pb.java).nest_in_file_class = YES; - sint32 value = 1; } // == Types == message PatioType { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioBoolType bool = 1; PatioByteType byte = 2; @@ -506,38 +392,29 @@ message PatioType { } message PatioBoolType { - option features.(pb.java).nest_in_file_class = YES; } message PatioByteType { - option features.(pb.java).nest_in_file_class = YES; } message PatioDataPtrType { - option features.(pb.java).nest_in_file_class = YES; } message PatioFunctionPtrType { - option features.(pb.java).nest_in_file_class = YES; } message PatioIntType { - option features.(pb.java).nest_in_file_class = YES; } message PatioInt32Type { - option features.(pb.java).nest_in_file_class = YES; } message PatioVoidType { - option features.(pb.java).nest_in_file_class = YES; } // == Data layouts == message PatioDataLayout { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioDataLayoutArray array = 1; PatioDataLayoutBool bool = 2; @@ -551,47 +428,35 @@ message PatioDataLayout { } message PatioDataLayoutArray { - option features.(pb.java).nest_in_file_class = YES; - PatioDataLayout element = 1; uint32 size = 2; } message PatioDataLayoutBool { - option features.(pb.java).nest_in_file_class = YES; } message PatioDataLayoutByte { - option features.(pb.java).nest_in_file_class = YES; } message PatioDataLayoutDataPtr { - option features.(pb.java).nest_in_file_class = YES; } message PatioDataLayoutFunctionPtr { - option features.(pb.java).nest_in_file_class = YES; } message PatioDataLayoutInt { - option features.(pb.java).nest_in_file_class = YES; } message PatioDataLayoutInt32 { - option features.(pb.java).nest_in_file_class = YES; } message PatioDataLayoutStruct { - option features.(pb.java).nest_in_file_class = YES; - repeated PatioDataLayout elements = 1; } // == Data values == message PatioDataValue { - option features.(pb.java).nest_in_file_class = YES; - oneof value { PatioDataValueArray array = 1; PatioDataValueBool bool = 2; @@ -604,44 +469,30 @@ message PatioDataValue { } message PatioDataValueArray { - option features.(pb.java).nest_in_file_class = YES; - PatioDataLayout element_layout = 1; repeated PatioDataValue elements = 2; } message PatioDataValueBool { - option features.(pb.java).nest_in_file_class = YES; - bool value = 1; } message PatioDataValueByte { - option features.(pb.java).nest_in_file_class = YES; - uint32 value = 1; } message PatioDataValueDataPtr { - option features.(pb.java).nest_in_file_class = YES; - PatioDataPtrValue value = 1; } message PatioDataValueInt { - option features.(pb.java).nest_in_file_class = YES; - PatioIntValue value = 1; } message PatioDataValueInt32 { - option features.(pb.java).nest_in_file_class = YES; - PatioIntValue value = 1; } message PatioDataValueStruct { - option features.(pb.java).nest_in_file_class = YES; - repeated PatioDataValue elements = 1; } diff --git a/protobuf/sources.proto b/protobuf/sources.proto index 78f66e75..251ef69c 100644 --- a/protobuf/sources.proto +++ b/protobuf/sources.proto @@ -1,12 +1,9 @@ -edition = "2024"; -import "google/protobuf/java_features.proto"; +syntax = "proto3"; option java_package = "org.shedlang.compiler.sources.protobuf"; option java_outer_classname = "SourcesProtobuf"; message Source { - option features.(pb.java).nest_in_file_class = YES; - oneof value { NullSource null_source = 1; RuntimeSource runtime_source = 2; @@ -15,24 +12,18 @@ message Source { } message NullSource { - option features.(pb.java).nest_in_file_class = YES; } message RuntimeSource { - option features.(pb.java).nest_in_file_class = YES; } message FileFragmentSource { - option features.(pb.java).nest_in_file_class = YES; - SourceText source_text = 1; uint32 start_character_index = 2; uint32 end_character_index = 3; } message SourceText { - option features.(pb.java).nest_in_file_class = YES; - string name = 1; string contents = 2; } -- cgit v1.2.3