diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-03-22 12:54:32 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-03-22 12:55:20 +0000 |
| commit | 920d6cf0706fbb5dc7f03fb48b0f9b9883b479cd (patch) | |
| tree | a509ff09c1a855a7cd0efcbf8d83e73019426d74 | |
| parent | fdb826e5991cbb080b81fcfb6eb444526cacab68 (diff) | |
Wrap unions in tables
| -rw-r--r-- | flatbuffers/patio.fbs | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/flatbuffers/patio.fbs b/flatbuffers/patio.fbs index e002b5be..266b12ef 100644 --- a/flatbuffers/patio.fbs +++ b/flatbuffers/patio.fbs @@ -4,7 +4,7 @@ namespace Patio; // == Data layouts == -union PatioDataLayout { +union PatioDataLayoutValue { PatioDataLayoutArray, PatioDataLayoutBool, PatioDataLayoutByte, @@ -15,6 +15,10 @@ union PatioDataLayout { PatioDataLayoutStruct, } +table PatioDataLayout { + value:PatioDataLayoutValue (required); +} + table PatioDataLayoutArray { element:PatioDataLayout; size:uint; @@ -62,12 +66,16 @@ table PatioDataPtrValueNull { // == Int values == -union PatioIntValue { +union PatioIntValueValue { PatioIntValueByteOffsetOf, PatioIntValueByteSizeOf, PatioIntValueLiteral, } +table PatioIntValue { + value:PatioIntValueValue (required); +} + table PatioIntValueByteOffsetOf { layout:PatioDataLayout; offset:[uint]; @@ -83,7 +91,7 @@ table PatioIntValueLiteral { // == Data values == -union PatioDataValue { +union PatioDataValueValue { PatioDataValueArray, PatioDataValueBool, PatioDataValueByte, @@ -93,6 +101,10 @@ union PatioDataValue { PatioDataValueStruct, } +table PatioDataValue { + value:PatioDataValueValue (required); +} + table PatioDataValueArray { element_layout:PatioDataLayout; elements:[PatioDataValue]; @@ -124,7 +136,7 @@ table PatioDataValueStruct { // == Types == -union PatioType { +union PatioTypeValue { PatioBoolType, PatioByteType, PatioDataPtrType, @@ -134,6 +146,10 @@ union PatioType { PatioVoidType, } +table PatioType { + value:PatioType (required); +} + table PatioBoolType { } @@ -157,7 +173,7 @@ table PatioVoidType { // == Operands == -union PatioOperand { +union PatioOperandValue { PatioBoolConst, PatioByteConst, PatioDataPtrConst, @@ -167,6 +183,10 @@ union PatioOperand { PatioLocalRef, } +table PatioOperand { + value:PatioOperandValue (required); +} + table PatioBoolConst { value:bool; } @@ -197,7 +217,7 @@ table PatioLocalRef { // == Instructions == -union PatioInstruction { +union PatioInstructionValue { PatioBlock, PatioBoolToInt, PatioCall, @@ -227,6 +247,10 @@ union PatioInstruction { PatioVarStore, } +table PatioInstruction { + value:PatioInstructionValue (required); +} + table PatioBlock { source:Sources.Source; body:[PatioInstruction]; @@ -429,7 +453,7 @@ table PatioLocal { // == Compilation unit elements == -union PatioCompilationUnitElement { +union PatioCompilationUnitElementValue { PatioDataElementImmutableDefinition, PatioDataElementMutableDeclaration, PatioDataElementMutableDefinition, @@ -438,6 +462,10 @@ union PatioCompilationUnitElement { PatioFunctionDefinition, } +table PatioCompilationUnitElement { + value:PatioCompilationUnitElementValue (required); +} + table PatioDataElementImmutableDefinition { source:Sources.Source; name:string; |
