├── internal ├── x │ ├── xfs │ │ └── testdata │ │ │ ├── empty.txt │ │ │ ├── test.txt │ │ │ └── empty#@TABLEAU.csv │ └── xproto │ │ └── constant.go ├── protogen │ ├── testdata │ │ ├── output │ │ │ └── proto │ │ │ │ └── common.proto │ │ └── csv │ │ │ ├── Unittest#@TABLEAU.csv │ │ │ ├── Unittest#Enum.csv │ │ │ └── Unittest#ItemConf.csv │ └── version.go ├── importer │ ├── testdata │ │ ├── Test#UTF8-BOM.csv │ │ ├── Test#@TABLEAU.csv │ │ ├── Test#Item.csv │ │ ├── Test_Second#Item.csv │ │ ├── Test#Hero.csv │ │ ├── Test_Second#@TABLEAU.csv │ │ ├── Test_Second#Hero.csv │ │ ├── Test_Second.xml │ │ ├── InvalidMeta2.xml │ │ ├── NotSupportAliasNode.yaml │ │ ├── InvalidMeta1.xml │ │ └── TestTemplate.yaml │ ├── metasheet │ │ └── metasheet.go │ └── book │ │ └── options.go ├── confgen │ ├── version.go │ ├── testdata │ │ ├── Metasheet.yaml │ │ └── Metasheet.xml │ └── stats.go ├── types │ └── list.go ├── tools │ └── generate.go ├── strcase │ ├── context.go │ └── doc.go └── printer │ └── printer_test.go ├── cmd └── tableauc │ └── testdata │ ├── csv │ ├── Item#@TABLEAU.csv │ ├── Merger1#@TABLEAU.csv │ ├── Scatter1#@TABLEAU.csv │ ├── Item#ItemConf.csv │ ├── Merger1#MergerZone.csv │ ├── Merger2#MergerZone.csv │ ├── Merger3#MergerZone.csv │ ├── Scatter1#ScatterZone.csv │ ├── Scatter2#ScatterZone.csv │ └── Scatter3#ScatterZone.csv │ ├── config.yaml │ └── config_subdir_rewrites.yaml ├── testdata └── unittest │ ├── Unittest#@TABLEAU.csv │ ├── invalidconf │ ├── Empty.json │ ├── Empty.txtpb │ ├── ItemConf.json │ └── ItemConf.txtpb │ ├── patchresult │ ├── ModeOnlyPatch-but-no-valid-patch-file.json │ ├── PatchDirs-replace.json │ ├── PatchPaths-replace.json │ ├── PatchDirs-replace-not-existed.json │ ├── ModeOnlyPatch.json │ ├── ModeOnlyMain.json │ ├── PatchDirs-merge-not-existed.json │ ├── PatchDirs-merge-none-map.json │ ├── PatchPaths-merge-none-map.json │ ├── PatchPaths-with-PatchDirs-merge-none-map.json │ ├── PatchDirs-merge-map.json │ ├── PatchPaths-different-format-merge-map.json │ ├── PatchDirs-merge-multiple-dirs.json │ └── PatchPaths-merge-multiple-paths.json │ ├── conf │ ├── ItemConf.binpb │ ├── PatchReplaceConf.json │ ├── ItemConf.json │ ├── ItemConf.txtpb │ └── PatchMergeConf.json │ ├── Unittest#Transpose.csv │ ├── Unittest#ItemConf.csv │ ├── patchconf │ ├── PatchReplaceConf.json │ └── PatchMergeConf.json │ ├── Unittest2#ItemConf.csv │ ├── Unittest#IncellMap.csv │ └── patchconf2 │ ├── PatchMergeConf.json │ └── PatchMergeConf.txtpb ├── test └── functest │ ├── testdata │ ├── default │ │ ├── excel │ │ │ ├── map │ │ │ │ ├── Map#@TABLEAU.csv │ │ │ │ ├── HorizontalMap#@TABLEAU.csv │ │ │ │ ├── VerticalMap#@TABLEAU.csv │ │ │ │ ├── Map#IncellMap.csv │ │ │ │ ├── Map#EmptyKeyMap.csv │ │ │ │ ├── VerticalMap#VerticalPredefinedStructMap.csv │ │ │ │ ├── Map#EnumKeyMap.csv │ │ │ │ ├── VerticalMap#VerticalUnionMap.csv │ │ │ │ ├── HorizontalMap#HorizontalPredefinedStructMap.csv │ │ │ │ ├── VerticalMap#VerticalWrappedUnionMap.csv │ │ │ │ ├── HorizontalMap#HorizontalStructMap.csv │ │ │ │ ├── Map#HorizontalExplicitFixedSizeMap.csv │ │ │ │ ├── Map#HorizontalImplicitFixedSizeMap.csv │ │ │ │ ├── Map#IncellEnumMap.csv │ │ │ │ ├── VerticalMap#VerticalStructMap.csv │ │ │ │ ├── VerticalMap#UniqueFieldInVerticalStructMap.csv │ │ │ │ ├── HorizontalMap#HorizontalUnionMap.csv │ │ │ │ ├── HorizontalMap#HorizontalColumnSkippedMap.csv │ │ │ │ └── HorizontalMap#HorizontalWrappedUnionMap.csv │ │ │ ├── list │ │ │ │ ├── List#@TABLEAU.csv │ │ │ │ ├── VerticalList#@TABLEAU.csv │ │ │ │ ├── HorizontalList#@TABLEAU.csv │ │ │ │ ├── List#IncellScalarList.csv │ │ │ │ ├── VerticalList#VerticalScalarList.csv │ │ │ │ ├── List#IncellPredefinedStructList.csv │ │ │ │ ├── List#incellEnumList.csv │ │ │ │ ├── List#IncellStructList.csv │ │ │ │ ├── VerticalList#VerticalIncellPredefStructList.csv │ │ │ │ ├── VerticalList#VerticalIncellStructList.csv │ │ │ │ ├── VerticalList#VerticalPredefinedStructList.csv │ │ │ │ ├── VerticalList#VerticalEnumList.csv │ │ │ │ ├── HorizontalList#HorizontalIncellInStructList.csv │ │ │ │ ├── HorizontalList#HorizontalIncellPdefStructList.csv │ │ │ │ ├── HorizontalList#HorizontalIncellStructList.csv │ │ │ │ ├── HorizontalList#HorizontalIncellPdefStructList2.csv │ │ │ │ ├── HorizontalList#HorizontalEnumList.csv │ │ │ │ ├── VerticalList#VerticalUnionList.csv │ │ │ │ ├── VerticalList#VerticalWrappedUnionList.csv │ │ │ │ ├── HorizontalList#HorizontalPredefinedStructList.csv │ │ │ │ ├── VerticalList#VerticalStructList.csv │ │ │ │ ├── HorizontalList#HorizontalStructList.csv │ │ │ │ ├── List#HorizontalExplicitFixedSizeList.csv │ │ │ │ ├── List#HorizontalImplicitFixedSizeList.csv │ │ │ │ ├── VerticalList#UniqueFieldInVerticalStructList.csv │ │ │ │ ├── HorizontalList#HorizontalScalarList.csv │ │ │ │ ├── HorizontalList#HorizontalUnionList.csv │ │ │ │ ├── HorizontalList#HorizontalColumnSkippedList.csv │ │ │ │ ├── HorizontalList#HorizontalWrappedUnionList.csv │ │ │ │ └── VerticalList#VerticalIncellUnionList.csv │ │ │ ├── misc │ │ │ │ ├── Note#@TABLEAU.csv │ │ │ │ ├── TypeReuse#@TABLEAU.csv │ │ │ │ ├── TypeReuse#ScopedTypeReuseStruct.csv │ │ │ │ ├── Note#NoteHorizontalListNesting.csv │ │ │ │ ├── Note#NoteHorizontalMapNesting.csv │ │ │ │ ├── TypeReuse#ScopedTypeReuseListElem.csv │ │ │ │ └── TypeReuse#ScopedTypeReuseMapValue.csv │ │ │ ├── scalar │ │ │ │ ├── Scalar#@TABLEAU.csv │ │ │ │ └── Scalar#Scalar.csv │ │ │ ├── struct │ │ │ │ ├── Struct#@TABLEAU.csv │ │ │ │ ├── Struct#PredefinedInCellStruct.csv │ │ │ │ ├── Struct#CrossCellStruct.csv │ │ │ │ ├── Struct#InCellStruct.csv │ │ │ │ ├── Struct#PredefinedCrossCellStruct.csv │ │ │ │ └── Struct#CrossCellNamedStruct.csv │ │ │ ├── fieldprop │ │ │ │ ├── Common#@TABLEAU.csv │ │ │ │ ├── FieldProp#@TABLEAU.csv │ │ │ │ ├── Optional#FieldPropOptional3.csv │ │ │ │ ├── Optional#FieldPropOptionalList4.csv │ │ │ │ ├── Optional#FieldPropOptionalMap4.csv │ │ │ │ ├── Optional#FieldPropOptional2.csv │ │ │ │ ├── FieldProp#FieldPropRefer.csv │ │ │ │ ├── Optional#FieldPropOptionalList3.csv │ │ │ │ ├── Common#EquipConf.csv │ │ │ │ ├── Common#ItemConf.csv │ │ │ │ ├── Optional#FieldPropOptionalMap3.csv │ │ │ │ ├── FieldProp#FieldPropUnique.csv │ │ │ │ ├── Optional#FieldPropOptionalList1.csv │ │ │ │ ├── Optional#FieldPropOptionalList2.csv │ │ │ │ ├── Optional#FieldPropOptionalMap2.csv │ │ │ │ ├── Optional#FieldPropOptional.csv │ │ │ │ ├── FieldProp#FieldPropForm.csv │ │ │ │ ├── Optional#FieldPropOptionalList.csv │ │ │ │ ├── Optional#FieldPropOptionalMap.csv │ │ │ │ ├── FieldProp#FieldPropOrder.csv │ │ │ │ ├── Optional#@TABLEAU.csv │ │ │ │ ├── FieldProp#FieldPropSep.csv │ │ │ │ ├── FieldProp#FieldPropSequence.csv │ │ │ │ └── FieldProp#FieldProp.csv │ │ │ ├── nesting │ │ │ │ ├── ListInList#@TABLEAU.csv │ │ │ │ ├── ListInMap#@TABLEAU.csv │ │ │ │ ├── MapInList#@TABLEAU.csv │ │ │ │ ├── MapInMap#@TABLEAU.csv │ │ │ │ ├── StructInList#@TABLEAU.csv │ │ │ │ ├── StructInMap#@TABLEAU.csv │ │ │ │ ├── StructInStruct#@TABLEAU.csv │ │ │ │ ├── KeyedListInKeyedList#@TABLEAU.csv │ │ │ │ ├── ListInList#IncellListInVerticalList.csv │ │ │ │ ├── ListInMap#IncellListInVerticalMap.csv │ │ │ │ ├── StructInStruct#StructInStruct.csv │ │ │ │ ├── StructInMap#StructInVerticalMap.csv │ │ │ │ ├── StructInStruct#IncellStructInStruct.csv │ │ │ │ ├── StructInStruct#PredefinedStructInStruct.csv │ │ │ │ ├── StructInMap#IncellStructInVerticalMap.csv │ │ │ │ ├── StructInMap#PredefinedStructInVerticalMap.csv │ │ │ │ ├── MapInList#IncellMapInVerticalList.csv │ │ │ │ ├── MapInMap#IncellMapInVerticalMap.csv │ │ │ │ ├── StructInList#IncellStructInVerticalList.csv │ │ │ │ ├── StructInList#StructInVerticalList.csv │ │ │ │ ├── KeyedListInKeyedList#IncellKListInVerticalKList.csv │ │ │ │ ├── ListInList#VerticalListInVerticalKeyedList.csv │ │ │ │ ├── ListInMap#VerticalListInVerticalMap.csv │ │ │ │ ├── MapInList#VerticalMapInVerticalKeyedList.csv │ │ │ │ ├── ListInMap#IncellListInHMap.csv │ │ │ │ ├── KeyedListInKeyedList#VerticalKListInVerticalKList.csv │ │ │ │ ├── MapInMap#IncellMapInHMap.csv │ │ │ │ ├── StructInList#IncellStructInHorizontaListFF.csv │ │ │ │ ├── ListInMap#IncellStructListInVMap.csv │ │ │ │ ├── ListInList#HorizontalListInVerticalList.csv │ │ │ │ ├── ListInMap#HorizontalListInVerticalMap.csv │ │ │ │ ├── MapInList#HorizontalMapInVerticalList.csv │ │ │ │ ├── MapInMap#HorizontalMapInVerticalMap.csv │ │ │ │ ├── MapInMap#VerticalMapInVerticalMap.csv │ │ │ │ ├── StructInList#StructInHorizontaListFF.csv │ │ │ │ ├── StructInList#PredefStructInHorizontaListFF.csv │ │ │ │ ├── ListInList#HPredefStructListInHListFF.csv │ │ │ │ ├── ListInList#HorizontalListInHorizontaListFF.csv │ │ │ │ ├── MapInList#HPredefStructMapInHListFF.csv │ │ │ │ ├── MapInList#HorizontalMapInHorizontalListFF.csv │ │ │ │ ├── ListInMap#HorizontalListInHMap.csv │ │ │ │ └── MapInMap#HorizontalMapInHMap.csv │ │ │ ├── keyedlist │ │ │ │ ├── KeyedList#@TABLEAU.csv │ │ │ │ ├── VerticalKeyedList#@TABLEAU.csv │ │ │ │ ├── KeyedList#IncellScalarKeyedList.csv │ │ │ │ ├── VerticalKeyedList#VerticalScalarKeyedList.csv │ │ │ │ ├── KeyedList#IncellEnumKeyedList.csv │ │ │ │ ├── VerticalKeyedList#VerticalEnumKeyedList.csv │ │ │ │ └── VerticalKeyedList#VerticalStructKeyedList.csv │ │ │ ├── wellknown │ │ │ │ ├── WellKnown#@TABLEAU.csv │ │ │ │ ├── WellKnown#WellKnownTypeTime.csv │ │ │ │ ├── WellKnown#WellKnownTypeDate.csv │ │ │ │ ├── WellKnown#WellKnownTypeDuration.csv │ │ │ │ ├── WellKnown#WellKnownTypeFraction.csv │ │ │ │ ├── WellKnown#WellKnownTypeComparator.csv │ │ │ │ ├── WellKnown#WellKnownTypeDatetime.csv │ │ │ │ └── WellKnown#WellKnownTypeVersion.csv │ │ │ ├── dev │ │ │ │ ├── list │ │ │ │ │ ├── List#@TABLEAU.csv │ │ │ │ │ ├── List#FixedList.csv │ │ │ │ │ └── List#EmptyElemList.csv │ │ │ │ ├── Test#Sheet2.csv │ │ │ │ ├── hero │ │ │ │ │ ├── Hero#FirstVListField.csv │ │ │ │ │ ├── Hero#VIncellStructList.csv │ │ │ │ │ ├── Hero#@TABLEAU.csv │ │ │ │ │ ├── Hero#Hero.csv │ │ │ │ │ ├── HeroA#Hero.csv │ │ │ │ │ └── HeroB#Hero.csv │ │ │ │ ├── Test#@TABLEAU.csv │ │ │ │ ├── Test#Exchange.csv │ │ │ │ └── Test#Reward.csv │ │ │ ├── enum │ │ │ │ ├── Enum#@TABLEAU.csv │ │ │ │ ├── Enum#EnumJobType.csv │ │ │ │ ├── Enum#Job.csv │ │ │ │ └── Enum#EnumJobTypeUse.csv │ │ │ ├── metasheet │ │ │ │ ├── SheetMode#ItemType.csv │ │ │ │ ├── Merger1#@TABLEAU.csv │ │ │ │ ├── Scatter1#@TABLEAU.csv │ │ │ │ ├── BookAlias#@TABLEAU.csv │ │ │ │ ├── Metasheet#RowAndLine.csv │ │ │ │ ├── BookAlias#Scalar.csv │ │ │ │ ├── Merger1#MetasheetOptionMerger.csv │ │ │ │ ├── Merger1#MetasheetOptionMerger1.csv │ │ │ │ ├── Merger2#MetasheetOptionMerger.csv │ │ │ │ ├── Merger3#MetasheetOptionMerger.csv │ │ │ │ ├── Scatter2#MetasheetOptionScatter.csv │ │ │ │ ├── Scatter1#MetasheetOptionScatter.csv │ │ │ │ ├── Scatter1#MetasheetOptionScatter1.csv │ │ │ │ ├── Scatter3#MetasheetOptionScatter.csv │ │ │ │ ├── Metasheet#Index.csv │ │ │ │ ├── SheetMode#EnumTypeReuseInBook.csv │ │ │ │ ├── SheetMode#StructTaskReward.csv │ │ │ │ ├── Metasheet#@TABLEAU.csv │ │ │ │ ├── Metasheet#Transpose.csv │ │ │ │ ├── SheetMode#UnionSimpleTarget.csv │ │ │ │ ├── SheetMode#StructType.csv │ │ │ │ ├── SheetMode#@TABLEAU.csv │ │ │ │ ├── SheetMode#StructTypeReuseInBook.csv │ │ │ │ ├── SheetMode#EnumType.csv │ │ │ │ ├── SheetMode#UnionTaskTarget.csv │ │ │ │ └── SheetMode#UnionTypeReuseInBook.csv │ │ │ └── union │ │ │ │ ├── Union#Target.csv │ │ │ │ ├── Union#@TABLEAU.csv │ │ │ │ ├── Union#TypedUnion.csv │ │ │ │ ├── Union#PredefinedUnion.csv │ │ │ │ ├── Union#UnionFieldCapTarget.csv │ │ │ │ ├── Union#UnionTypedTarget.csv │ │ │ │ └── Union#FieldCapUnion.csv │ │ ├── csv │ │ │ └── BOM │ │ │ │ ├── UTF8BOM#@TABLEAU.csv │ │ │ │ └── UTF8BOM#UTF8BOM.csv │ │ ├── yaml │ │ │ ├── metasheet │ │ │ │ ├── Merger1.yaml │ │ │ │ ├── Merger2.yaml │ │ │ │ ├── YamlScatter1.yaml │ │ │ │ ├── YamlScatter2.yaml │ │ │ │ ├── YamlScatter.yaml │ │ │ │ └── Merger.yaml │ │ │ ├── patch │ │ │ │ └── overlays │ │ │ │ │ ├── dev │ │ │ │ │ └── Env.yaml │ │ │ │ │ ├── test │ │ │ │ │ └── Env.yaml │ │ │ │ │ └── prod │ │ │ │ │ └── Env.yaml │ │ │ ├── misc │ │ │ │ ├── Acronym.yaml │ │ │ │ └── SpecialValue.yaml │ │ │ ├── Enum.yaml │ │ │ └── Scalar.yaml │ │ └── xml │ │ │ ├── patch │ │ │ └── overlays │ │ │ │ ├── dev │ │ │ │ └── Env.xml │ │ │ │ ├── prod │ │ │ │ └── Env.xml │ │ │ │ └── test │ │ │ │ └── Env.xml │ │ │ └── metasheet │ │ │ ├── Merger2.xml │ │ │ ├── Merger.xml │ │ │ ├── Metasheet.xml │ │ │ └── Merger1.xml │ └── custom │ │ └── excel │ │ └── header │ │ ├── Header#@TABLEAU_CUSTOM.csv │ │ └── Header#TableHeader.csv │ ├── conf │ ├── default │ │ ├── YamlAcronymConf.json │ │ ├── FieldPropRefer.json │ │ ├── IncellScalarList.json │ │ ├── Scalar.json │ │ ├── IncellScalarKeyedList.json │ │ ├── XMLStructConf2.json │ │ ├── AliasedSheetScalar.json │ │ ├── YamlEnumConf.json │ │ ├── YamlScatter1_YamlScatterConf.json │ │ ├── YamlScatter2_YamlScatterConf.json │ │ ├── YamlScatter_YamlScatterConf.json │ │ ├── YamlSpecialValueConf.json │ │ ├── CrossCellStruct.json │ │ ├── incellEnumList.json │ │ ├── HorizontalEnumList.json │ │ ├── IncellEnumKeyedList.json │ │ ├── VerticalScalarList.json │ │ ├── StructInStruct.json │ │ ├── VerticalScalarKeyedList.json │ │ ├── WellKnownTypeTime.json │ │ ├── IncellStructInStruct.json │ │ ├── dev │ │ │ ├── XmlPatchConf.json │ │ │ └── YamlPatchConf.json │ │ ├── PredefinedStructInStruct.json │ │ ├── IncellMap.json │ │ ├── WellKnownTypeDuration.json │ │ ├── VerticalEnumKeyedList.json │ │ ├── Scatter2_MetasheetOptionScatter.json │ │ ├── ScopedTypeReuseStruct.json │ │ ├── Scatter1_MetasheetOptionScatter.json │ │ ├── Scatter1_MetasheetOptionScatter1.json │ │ ├── Scatter3_MetasheetOptionScatter.json │ │ ├── WellKnownTypeDate.json │ │ ├── HorizontalExplicitFixedSizeList.json │ │ ├── YamlScalarConf.json │ │ ├── HorizontalExplicitFixedSizeMap.json │ │ ├── VerticalEnumList.json │ │ ├── HorizontalScalarList.json │ │ ├── CrossCellNamedStruct.json │ │ ├── IncellStructList.json │ │ ├── IncellPredefinedStructList.json │ │ ├── ItemConf.json │ │ ├── VerticalIncellStructList.json │ │ ├── VerticalPredefinedStructList.json │ │ ├── HorizontalPredefinedStructList.json │ │ ├── VerticalIncellPredefStructList.json │ │ ├── HorizontalStructList.json │ │ ├── EmptyKeyMap.json │ │ ├── HorizontalImplicitFixedSizeList.json │ │ ├── HorizontalIncellStructList.json │ │ ├── HorizontalPredefinedStructMap.json │ │ ├── RowAndLine.json │ │ ├── UTF8BOM.json │ │ ├── VerticalPredefinedStructMap.json │ │ ├── WellKnownTypeDatetime.json │ │ ├── EquipConf.json │ │ ├── HorizontalIncellPdefStructList.json │ │ ├── HorizontalIncellPdefStructList2.json │ │ ├── HorizontalStructMap.json │ │ ├── HorizontalImplicitFixedSizeMap.json │ │ ├── test │ │ │ ├── YamlPatchConf.json │ │ │ └── XmlPatchConf.json │ │ ├── IncellMapInHMap.json │ │ ├── EnumKeyMap.json │ │ ├── StructInHorizontaListFF.json │ │ ├── IncellStructInHorizontaListFF.json │ │ ├── PredefStructInHorizontaListFF.json │ │ ├── YamlMergerConf.json │ │ ├── HorizontalIncellInStructList.json │ │ ├── ScopedTypeReuseListElem.json │ │ ├── NoteHorizontalListNesting.json │ │ ├── ScopedTypeReuseMapValue.json │ │ ├── StructInVerticalMap.json │ │ ├── VerticalStructList.json │ │ ├── IncellStructInVerticalMap.json │ │ ├── NoteHorizontalMapNesting.json │ │ ├── PredefinedStructInVerticalMap.json │ │ ├── UniqueFieldInVerticalStructList.json │ │ ├── VerticalStructMap.json │ │ ├── IncellKListInVerticalKList.json │ │ ├── prod │ │ │ ├── YamlPatchConf.json │ │ │ └── XmlPatchConf.json │ │ ├── EnumJobTypeUse.json │ │ ├── IncellListInVerticalList.json │ │ ├── FieldPropUnique.json │ │ ├── IncellListInVerticalMap.json │ │ ├── Index.json │ │ ├── VerticalUnionList.json │ │ ├── WellKnownTypeFraction.json │ │ ├── FirstVListField.json │ │ ├── HorizontalUnionList.json │ │ ├── StructInVerticalList.json │ │ ├── Transpose.json │ │ ├── HorizontalUnionMap.json │ │ ├── IncellMapInVerticalList.json │ │ ├── VerticalUnionMap.json │ │ ├── MetasheetOptionMerger.json │ │ ├── IncellStructInVerticalList.json │ │ ├── IncellMapInVerticalMap.json │ │ ├── EnumTypeReuseInBook.json │ │ ├── IncellListInHMap.json │ │ ├── HorizontalListInHMap.json │ │ ├── HorizontalMapInHMap.json │ │ ├── FieldPropOptional.json │ │ ├── HPredefStructListInHListFF.json │ │ ├── HorizontalListInHorizontaListFF.json │ │ ├── HPredefStructMapInHListFF.json │ │ ├── HorizontalMapInHorizontalListFF.json │ │ ├── IncellEnumMap.json │ │ ├── VerticalStructKeyedList.json │ │ ├── InCellStruct.json │ │ ├── PredefinedInCellStruct.json │ │ ├── PredefinedCrossCellStruct.json │ │ ├── VerticalKListInVerticalKList.json │ │ ├── VerticalListInVerticalKeyedList.json │ │ ├── VerticalListInVerticalMap.json │ │ ├── VerticalMapInVerticalKeyedList.json │ │ ├── VerticalMapInVerticalMap.json │ │ ├── FieldPropOrder.json │ │ ├── VerticalWrappedUnionList.json │ │ ├── ExchangeInfo.json │ │ ├── FieldPropForm.json │ │ ├── HorizontalWrappedUnionList.json │ │ ├── YamlStructConf.json │ │ ├── HorizontalListInVerticalList.json │ │ ├── HorizontalMapInVerticalList.json │ │ ├── FieldProp.json │ │ ├── HorizontalListInVerticalMap.json │ │ ├── HorizontalMapInVerticalMap.json │ │ ├── VerticalWrappedUnionMap.json │ │ ├── HorizontalWrappedUnionMap.json │ │ └── YamlFieldPropOptionalConf.json │ └── custom │ │ └── TableHeader.json │ ├── bench_test.go │ ├── proto │ ├── default │ │ ├── common │ │ │ └── base.proto │ │ ├── yaml__misc__acronym.proto │ │ ├── yaml__enum.proto │ │ ├── yaml__misc__special_value.proto │ │ ├── excel__scalar__scalar.proto │ │ ├── yaml__metasheet__yaml_scatter.proto │ │ ├── csv__bom__utf_8_bom.proto │ │ ├── VerticalWrappedUnionList.json │ │ ├── xml__union.proto │ │ ├── yaml__metasheet__merger.proto │ │ ├── yaml__union.proto │ │ └── excel__metasheet__aliased_workbook.proto │ └── custom │ │ └── excel__header__header.proto │ ├── run.sh │ └── main.go ├── docs ├── intro.md ├── dev.md └── tutorial.md ├── .clang-format ├── .vscode └── settings.json ├── .github ├── dependabot.yml └── workflows │ └── lint.yml ├── codecov.yml ├── log ├── options.go └── logger_test.go ├── scripts └── gen_pb.sh ├── .gitignore └── .gitattributes /internal/x/xfs/testdata/empty.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/x/xfs/testdata/test.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Item#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/x/xfs/testdata/empty#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/unittest/Unittest#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/unittest/invalidconf/Empty.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/unittest/invalidconf/Empty.txtpb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/protogen/testdata/output/proto/common.proto: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/Map#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | > introduction to tableau -------------------------------------------------------------------------------- /internal/importer/testdata/Test#UTF8-BOM.csv: -------------------------------------------------------------------------------- 1 | ID,Name 2 | 1,苹果 -------------------------------------------------------------------------------- /test/functest/testdata/default/csv/BOM/UTF8BOM#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/List#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/misc/Note#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/scalar/Scalar#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/struct/Struct#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Common#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/HorizontalMap#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/VerticalMap#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/misc/TypeReuse#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInMap#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInMap#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/importer/testdata/Test#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias 2 | Item,ItemConf -------------------------------------------------------------------------------- /test/functest/testdata/custom/excel/header/Header#@TABLEAU_CUSTOM.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/keyedlist/KeyedList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInMap#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInStruct#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/importer/testdata/Test#Item.csv: -------------------------------------------------------------------------------- 1 | ID,Name 2 | 1,"Pike" 3 | 2,Thompson -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/keyedlist/VerticalKeyedList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/KeyedListInKeyedList#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/unittest/patchresult/ModeOnlyPatch-but-no-valid-patch-file.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /internal/confgen/version.go: -------------------------------------------------------------------------------- 1 | package confgen 2 | 3 | const Version = "0.8.2" 4 | -------------------------------------------------------------------------------- /internal/importer/testdata/Test_Second#Item.csv: -------------------------------------------------------------------------------- 1 | ID,Name 2 | 11,"Pike" 3 | 12,Thompson -------------------------------------------------------------------------------- /internal/protogen/version.go: -------------------------------------------------------------------------------- 1 | package protogen 2 | 3 | const Version = "0.9.0" 4 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Merger1#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Merger 2 | MergerZone,Merger*.csv 3 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Scatter1#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Scatter 2 | ScatterZone,Scatter*.csv 3 | -------------------------------------------------------------------------------- /internal/types/list.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | const DefaultListFieldOptNameSuffix = "List" 4 | -------------------------------------------------------------------------------- /internal/protogen/testdata/csv/Unittest#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Mode 2 | ItemConf, 3 | Enum,MODE_ENUM_TYPE_MULTI -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/List#IncellScalarList.csv: -------------------------------------------------------------------------------- 1 | ID 2 | []int32 3 | ID list 4 | "1,2,3" 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/YamlAcronymConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "inK8s": null, 3 | "apiv3Spec": "https://openai.com/" 4 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptional3.csv: -------------------------------------------------------------------------------- 1 | ID 2 | "map" 3 | Item ID 4 | 3 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/keyedlist/KeyedList#IncellScalarKeyedList.csv: -------------------------------------------------------------------------------- 1 | ID 2 | [] 3 | ID list 4 | "1,2,3" 5 | -------------------------------------------------------------------------------- /testdata/unittest/conf/ItemConf.binpb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tableauio/tableau/HEAD/testdata/unittest/conf/ItemConf.binpb -------------------------------------------------------------------------------- /test/functest/conf/default/FieldPropRefer.json: -------------------------------------------------------------------------------- 1 | { 2 | "idList": [ 3 | 1, 4 | 2, 5 | 1001 6 | ] 7 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellScalarList.json: -------------------------------------------------------------------------------- 1 | { 2 | "idList": [ 3 | 1, 4 | 2, 5 | 3 6 | ] 7 | } -------------------------------------------------------------------------------- /test/functest/conf/default/Scalar.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "name": "Apple", 4 | "desc": "A kind of delicious fruit." 5 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalList4.csv: -------------------------------------------------------------------------------- 1 | ID 2 | "map" 3 | Item ID 4 | 4 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalMap4.csv: -------------------------------------------------------------------------------- 1 | ID 2 | "map" 3 | Item ID 4 | 4 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalScalarList.csv: -------------------------------------------------------------------------------- 1 | ID 2 | []uint32 3 | ID 4 | "1,2,3" 5 | "1,2" 6 | 1 7 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Item#ItemConf.csv: -------------------------------------------------------------------------------- 1 | ID,Num 2 | "map",int32 3 | Item's ID,Item's num 4 | 1,10 5 | 2,20 6 | 3,30 7 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellScalarKeyedList.json: -------------------------------------------------------------------------------- 1 | { 2 | "idList": [ 3 | 1, 4 | 2, 5 | 3 6 | ] 7 | } -------------------------------------------------------------------------------- /test/functest/conf/default/XMLStructConf2.json: -------------------------------------------------------------------------------- 1 | { 2 | "node": { 3 | "desc": "Multiple root nodes are supported." 4 | } 5 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/List#IncellPredefinedStructList.csv: -------------------------------------------------------------------------------- 1 | Item 2 | []{.Item} 3 | Item list 4 | "1:10,2:20,3:30" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/List#incellEnumList.csv: -------------------------------------------------------------------------------- 1 | Type 2 | []enum<.FruitType> 3 | Type list 4 | "Apple,Orange,Banana" 5 | -------------------------------------------------------------------------------- /testdata/unittest/Unittest#Transpose.csv: -------------------------------------------------------------------------------- 1 | ID,"map",Hero's ID,123,456,789 2 | Name,string,Hero's name,Robin,Superman,Thanos 3 | -------------------------------------------------------------------------------- /internal/importer/testdata/Test#Hero.csv: -------------------------------------------------------------------------------- 1 | first_name,last_name,username 2 | "Rob","Pike",rob 3 | Ken,Thompson,ken 4 | "Robert","Griesemer","gri" -------------------------------------------------------------------------------- /test/functest/testdata/default/csv/BOM/UTF8BOM#UTF8BOM.csv: -------------------------------------------------------------------------------- 1 | ID,Name 2 | "map",string 3 | 道具ID,道具名 4 | 1,Oragne 5 | 2,Banana 6 | 3,苹果 -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/list/List#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Nameline,Typeline,Datarow 2 | EmptyElemList,1,1,4 3 | FixedList,1,1,4 4 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/enum/Enum#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Mode 2 | EnumJobType,JobType,MODE_ENUM_TYPE 3 | EnumJobTypeUse,, 4 | -------------------------------------------------------------------------------- /internal/confgen/testdata/Metasheet.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": "@TABLEAU" 2 | ItemConf: 3 | Alias: ItemAliasConf 4 | OrderedMap: true 5 | HeroConf: 6 | -------------------------------------------------------------------------------- /internal/importer/testdata/Test_Second#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Scatter,Merger 2 | Item,ItemConf,"Test_*.csv",, 3 | Hero,HeroConf,,"Test_*.csv" -------------------------------------------------------------------------------- /test/functest/conf/custom/TableHeader.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "propList": [ 4 | 10, 5 | 20, 6 | 30 7 | ] 8 | } -------------------------------------------------------------------------------- /test/functest/conf/default/AliasedSheetScalar.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "name": "Apple", 4 | "desc": "A kind of delicious fruit." 5 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/List#IncellStructList.csv: -------------------------------------------------------------------------------- 1 | Item 2 | "[]{uint32 ID, int32 Num}Item" 3 | Item list 4 | "1:10,2:20,3:30" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/Map#IncellMap.csv: -------------------------------------------------------------------------------- 1 | Items 2 | "map" 3 | Items 4 | "1:Apple,2:Orange,3:Banana,4,:Peach" 5 | -------------------------------------------------------------------------------- /testdata/unittest/conf/PatchReplaceConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apple", 3 | "priceList": [ 4 | 10, 5 | 100 6 | ] 7 | } -------------------------------------------------------------------------------- /internal/importer/testdata/Test_Second#Hero.csv: -------------------------------------------------------------------------------- 1 | first_name,last_name,username 2 | "Rob","Pike",rob 3 | Ken,Thompson,ken 4 | "Robert","Griesemer","gri" -------------------------------------------------------------------------------- /test/functest/conf/default/YamlEnumConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "type": "FRUIT_TYPE_APPLE", 4 | "desc": "A kind of delicious fruit." 5 | } -------------------------------------------------------------------------------- /test/functest/conf/default/YamlScatter1_YamlScatterConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "strictStruct": { 3 | "id": 1, 4 | "name": "banana" 5 | } 6 | } -------------------------------------------------------------------------------- /test/functest/conf/default/YamlScatter2_YamlScatterConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "strictStruct": { 3 | "id": 2, 4 | "name": "orange" 5 | } 6 | } -------------------------------------------------------------------------------- /test/functest/conf/default/YamlScatter_YamlScatterConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "strictStruct": { 3 | "id": 100, 4 | "name": "apple" 5 | } 6 | } -------------------------------------------------------------------------------- /test/functest/conf/default/YamlSpecialValueConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "nameWithSpace": " This is an apple. ", 3 | "integerWithFractionalPart": 123 4 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/keyedlist/VerticalKeyedList#VerticalScalarKeyedList.csv: -------------------------------------------------------------------------------- 1 | ID 2 | [] 3 | ID 4 | "1,2,3" 5 | "4,5" 6 | 6 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/metasheet/Merger1.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": YamlMergerConf 2 | StructMap: 3 | 1: 4 | Name: orange 5 | Num: 10 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/metasheet/Merger2.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": YamlMergerConf 2 | StructMap: 3 | 2: 4 | Name: banana 5 | Num: 20 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/metasheet/YamlScatter1.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": YamlScatterConf 2 | StrictStruct: 3 | ID: 1 4 | Name: banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/metasheet/YamlScatter2.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": YamlScatterConf 2 | StrictStruct: 3 | ID: 2 4 | Name: orange 5 | -------------------------------------------------------------------------------- /testdata/unittest/Unittest#ItemConf.csv: -------------------------------------------------------------------------------- 1 | ID,Num 2 | "map|{sequence:1}",int32 3 | Item's ID,Item's num 4 | 1,100 5 | 2,200 6 | 3,300 7 | -------------------------------------------------------------------------------- /testdata/unittest/patchconf/PatchReplaceConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "priceList": [ 4 | 20, 5 | 200 6 | ] 7 | } -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchDirs-replace.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "priceList": [ 4 | 20, 5 | 200 6 | ] 7 | } -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchPaths-replace.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "priceList": [ 4 | 20, 5 | 200 6 | ] 7 | } -------------------------------------------------------------------------------- /test/functest/testdata/custom/excel/header/Header#TableHeader.csv: -------------------------------------------------------------------------------- 1 | "IDNote 2 | ID 3 | int32","PropNote 4 | Prop 5 | []int32|{sep:"";""}" 6 | 1,10;20;30 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/keyedlist/KeyedList#IncellEnumKeyedList.csv: -------------------------------------------------------------------------------- 1 | Type 2 | []> 3 | Type list 4 | "Apple,Orange,Banana" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalIncellPredefStructList.csv: -------------------------------------------------------------------------------- 1 | Item 2 | []{.Item} 3 | Item info 4 | 1:100 5 | "2:200,3:300" 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#ItemType.csv: -------------------------------------------------------------------------------- 1 | Name,Alias 2 | ITEM_TYPE_FRUIT,Fruit 3 | ITEM_TYPE_EQUIP,Equip 4 | ITEM_TYPE_BOX,Box 5 | -------------------------------------------------------------------------------- /testdata/unittest/Unittest2#ItemConf.csv: -------------------------------------------------------------------------------- 1 | ID,Num,Num 2 | "map|{sequence:1}",int32 3 | Item's ID,Item's num 4 | 1,100,1 5 | 2,200 6 | 3,300 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/Map#EmptyKeyMap.csv: -------------------------------------------------------------------------------- 1 | ID,Desc 2 | "map",string 3 | Item ID,Item name 4 | 1,Apple 5 | ,Orange 6 | 3,Banana 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Merger1#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Merger 2 | MetasheetOptionMerger,"Merger*.csv,Merger1#*.csv#MetasheetOptionMerger1" 3 | -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchDirs-replace-not-existed.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apple", 3 | "priceList": [ 4 | 10, 5 | 100 6 | ] 7 | } -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | ColumnLimit: 120 5 | --- 6 | Language: Proto 7 | BasedOnStyle: Google 8 | ColumnLimit: 120 9 | -------------------------------------------------------------------------------- /internal/importer/testdata/Test_Second.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /internal/protogen/testdata/csv/Unittest#Enum.csv: -------------------------------------------------------------------------------- 1 | FruitItemType,fruit item type note 2 | Number,Name,Alias 3 | 1,APPLE,apple 4 | 2,BANANA,banana 5 | 3,ORANGE,orange 6 | -------------------------------------------------------------------------------- /internal/x/xproto/constant.go: -------------------------------------------------------------------------------- 1 | package xproto 2 | 3 | const ( 4 | InternalProtoPackage = "internal" 5 | MetabookFullName = "internal.Metabook" 6 | ) 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalIncellStructList.csv: -------------------------------------------------------------------------------- 1 | Item 2 | "[]{int32 ID,int32 Num}Item" 3 | Item info 4 | 1:100 5 | "2:200,3:300" 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Scatter1#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Scatter 2 | MetasheetOptionScatter,"Scatter*.csv,Scatter1#*.csv#MetasheetOptionScatter1" 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.fontSize": 16, 3 | "protoc": { 4 | "options": [ 5 | "--proto_path=proto" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Merger1#MergerZone.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone’s ID,Zone’s name,Zone’s difficulty 4 | 1,Infinity,100 5 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Merger2#MergerZone.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone’s ID,Zone’s name,Zone’s difficulty 4 | 2,Desert,200 5 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Merger3#MergerZone.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone’s ID,Zone’s name,Zone’s difficulty 4 | 3,Snowfield,300 5 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Scatter1#ScatterZone.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone’s ID,Zone’s name,Zone’s difficulty 4 | 1,Infinity,100 5 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Scatter2#ScatterZone.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone’s ID,Zone’s name,Zone’s difficulty 4 | 2,Desert,200 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalPredefinedStructList.csv: -------------------------------------------------------------------------------- 1 | ID,Num 2 | [.Item]int32,int32 3 | Item ID,Item num 4 | 1,100 5 | 2,200 6 | 3,300 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/BookAlias#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Labels 2 | #,AliasedWorkbook, 3 | Scalar,AliasedSheetScalar,"app:gamesvr,patch:merge" 4 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/csv/Scatter3#ScatterZone.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone’s ID,Zone’s name,Zone’s difficulty 4 | 3,Snowfield,300 5 | -------------------------------------------------------------------------------- /internal/importer/metasheet/metasheet.go: -------------------------------------------------------------------------------- 1 | package metasheet 2 | 3 | const DefaultMetasheetName = "@TABLEAU" 4 | 5 | type Metasheet struct { 6 | Name string 7 | } 8 | -------------------------------------------------------------------------------- /internal/tools/generate.go: -------------------------------------------------------------------------------- 1 | package tools 2 | 3 | //go:generate go run cmd/ecode/main.go -config ../localizer/i18n/config/ecode/en.yaml -save ../../xerrors/ecode_generated.go 4 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptional2.csv: -------------------------------------------------------------------------------- 1 | ID,PropID 2 | "map",{Prop}uint32|{optional:true} 3 | Item ID,Prop ID 4 | 2,20 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/VerticalMap#VerticalPredefinedStructMap.csv: -------------------------------------------------------------------------------- 1 | ID,Num 2 | "map",int32 3 | Item ID,Item num 4 | 1,100 5 | 2,200 6 | 3,300 7 | -------------------------------------------------------------------------------- /test/functest/conf/default/CrossCellStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "property": { 3 | "id": 1, 4 | "name": "Orange", 5 | "desc": "A kind of sour fruit." 6 | } 7 | } -------------------------------------------------------------------------------- /test/functest/conf/default/incellEnumList.json: -------------------------------------------------------------------------------- 1 | { 2 | "typeList": [ 3 | "FRUIT_TYPE_APPLE", 4 | "FRUIT_TYPE_ORANGE", 5 | "FRUIT_TYPE_BANANA" 6 | ] 7 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/keyedlist/VerticalKeyedList#VerticalEnumKeyedList.csv: -------------------------------------------------------------------------------- 1 | Type 2 | []> 3 | Type 4 | "Apple,Orange" 5 | FRUIT_TYPE_BANANA 6 | 0 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/Map#EnumKeyMap.csv: -------------------------------------------------------------------------------- 1 | Type,Price 2 | "map, Item>",int32 3 | Item type,Item price 4 | Apple,100 5 | Orange,200 6 | Banana,300 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Metasheet#RowAndLine.csv: -------------------------------------------------------------------------------- 1 | "ID 2 | map 3 | Item ID","Name 4 | string 5 | Item name" 6 | 1,Apple 7 | 2,Orange 8 | 3,Sword 9 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalEnumList.json: -------------------------------------------------------------------------------- 1 | { 2 | "paramList": [ 3 | "FRUIT_TYPE_APPLE", 4 | "FRUIT_TYPE_ORANGE", 5 | "FRUIT_TYPE_BANANA" 6 | ] 7 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellEnumKeyedList.json: -------------------------------------------------------------------------------- 1 | { 2 | "typeList": [ 3 | "FRUIT_TYPE_APPLE", 4 | "FRUIT_TYPE_ORANGE", 5 | "FRUIT_TYPE_BANANA" 6 | ] 7 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalScalarList.json: -------------------------------------------------------------------------------- 1 | { 2 | "idList": [ 3 | 1, 4 | 2, 5 | 3, 6 | 1, 7 | 2, 8 | 1 9 | ] 10 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#FieldPropRefer.csv: -------------------------------------------------------------------------------- 1 | ID1,ID2,ID3 2 | "[]int32|refer:""ItemConf.ID,EquipConf.ID""}",int32,int32 3 | ID 1,ID 2,ID 3 4 | 1,2,1001 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalList3.csv: -------------------------------------------------------------------------------- 1 | ID,Name 2 | "map",[Reward]string|{optional:true} 3 | Item ID,Reward name 4 | 3,Orange 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/BookAlias#Scalar.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Desc 2 | uint32,string,string 3 | Item ID,Item Name,Item Description 4 | 1,Apple,A kind of delicious fruit. 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInList#IncellListInVerticalList.csv: -------------------------------------------------------------------------------- 1 | ID,Prop 2 | [Item]uint32,[]int32 3 | Item ID,Item props 4 | 1,"10,20,30" 5 | 2,"10,20" 6 | 3,10 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/scalar/Scalar#Scalar.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Desc 2 | uint32,string,string 3 | Item's ID,Item's Name,Item's Description 4 | 1,Apple,A kind of delicious fruit. 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/StructInStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "reward": { 3 | "id": 1, 4 | "item": { 5 | "id": 1, 6 | "num": 10 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalScalarKeyedList.json: -------------------------------------------------------------------------------- 1 | { 2 | "idList": [ 3 | 1, 4 | 2, 5 | 3, 6 | 4, 7 | 5, 8 | 6 9 | ] 10 | } -------------------------------------------------------------------------------- /test/functest/conf/default/WellKnownTypeTime.json: -------------------------------------------------------------------------------- 1 | { 2 | "beginTime": "37500s", 3 | "endTime": "41100s", 4 | "timeList": [ 5 | "37500s", 6 | "41100s" 7 | ] 8 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Common#EquipConf.csv: -------------------------------------------------------------------------------- 1 | ID,Damage 2 | "map|{unique:true}",int32 3 | Equip ID,Equip damage 4 | 1000,100 5 | 1001,200 6 | 1002,300 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Common#ItemConf.csv: -------------------------------------------------------------------------------- 1 | ID,Num 2 | "map|{sequence:1}",int32|{order:ORDER_ASC} 3 | Item ID,Item num 4 | 1,100 5 | 2,200 6 | 3,300 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalMap3.csv: -------------------------------------------------------------------------------- 1 | ID,Name 2 | "map","map|{optional:true}" 3 | Item ID,Reward name 4 | 3,Orange 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalEnumList.csv: -------------------------------------------------------------------------------- 1 | Type 2 | []enum<.FruitType> 3 | Type 4 | "Apple,Orange,Banana" 5 | "FRUIT_TYPE_APPLE,FRUIT_TYPE_ORANGE" 6 | 1 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInMap#IncellListInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Prop 2 | "map",[]int32 3 | Item ID,Item props 4 | 1,"10,20,30" 5 | 2,"10,20" 6 | 3,10 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#WellKnownTypeTime.csv: -------------------------------------------------------------------------------- 1 | BeginTime,EndTime,Time 2 | time,time,[]time 3 | Begin time,End time,Time 4 | 10:25:00,1125,"10:25:00,1125" 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellStructInStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "reward": { 3 | "id": 1, 4 | "item": { 5 | "id": 2, 6 | "num": 200 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/conf/default/dev/XmlPatchConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": "base", 3 | "strictStruct": { 4 | "start": "2026-10-01T06:06:06+08:00", 5 | "expiry": "7200s" 6 | } 7 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/Test#Sheet2.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Nameline,Typeline,Nested 2 | Activity,,1,1, 3 | Exchange,ExchangeInfo,0,0, 4 | Match,MatchConf,1,1,true 5 | Loader,,1,1,true 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Merger1#MetasheetOptionMerger.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 1,Infinity,100 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Merger1#MetasheetOptionMerger1.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 10,Marsh,1000 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Merger2#MetasheetOptionMerger.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 2,Desert,200 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Merger3#MetasheetOptionMerger.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 3,Snowfield,300 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Scatter2#MetasheetOptionScatter.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 2,Desert,200 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInStruct#StructInStruct.csv: -------------------------------------------------------------------------------- 1 | RewardID,RewardItemID,RewardItemNum 2 | {Reward}int32,{Item}int32,int32 3 | Reward ID,Item ID,Item num 4 | 1,1,10 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/PredefinedStructInStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "reward": { 3 | "id": 1, 4 | "item": { 5 | "id": 1, 6 | "num": 10 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalIncellInStructList.csv: -------------------------------------------------------------------------------- 1 | Task1Param,Task2Param,Task3Param 2 | [Task][]int32,[]int32,[]int32 3 | Task1,Task2,Task3 4 | 1,"2,3","4,5,6" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Scatter1#MetasheetOptionScatter.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 1,Infinity,100 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Scatter1#MetasheetOptionScatter1.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 10,Marsh,1000 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Scatter3#MetasheetOptionScatter.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Difficulty 2 | "map",string,int32 3 | Zone ID,Zone name,Zone difficulty 4 | 3,Snowfield,300 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#WellKnownTypeDate.csv: -------------------------------------------------------------------------------- 1 | BeginDate,EndDate,Date 2 | date,date,[]date 3 | Begin date,End date,Date 4 | 2020-01-01,20221010,"2020-01-01,20221010" 5 | -------------------------------------------------------------------------------- /internal/protogen/testdata/csv/Unittest#ItemConf.csv: -------------------------------------------------------------------------------- 1 | ID,Num,Type 2 | "map",int32,"enum<.FruitItemType>" 3 | Item's ID,Item's num,Item's type 4 | 1,100,apple 5 | 2,200,banana 6 | 3,300,orange 7 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemsMap": { 3 | "0": "Peach", 4 | "1": "Apple", 5 | "2": "Orange", 6 | "3": "Banana", 7 | "4": "" 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInMap#StructInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,ItemID,ItemNum 2 | "map",{Item}int32,int32 3 | Reward ID,Item ID,Item Num 4 | 1,1,10 5 | 2,2,20 6 | 3,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInStruct#IncellStructInStruct.csv: -------------------------------------------------------------------------------- 1 | RewardID,RewardItem 2 | {Reward}int32,"{int32 ID, int32 Num}Item" 3 | Reward ID,Reward item 4 | 1,"1,100" 5 | ,"2,200" 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInStruct#PredefinedStructInStruct.csv: -------------------------------------------------------------------------------- 1 | RewardID,RewardItemID,RewardItemNum 2 | {Reward}int32,{.Item}int32,int32 3 | Reward ID,Item ID,Item num 4 | 1,1,10 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/patch/overlays/dev/Env.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": YamlPatchConf 2 | Env: dev 3 | StrictStruct: 4 | ID: 0 5 | Name: "" 6 | Start: 2026-10-01 06:06:06 7 | Expiry: 2h 8 | -------------------------------------------------------------------------------- /test/functest/conf/default/WellKnownTypeDuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "duration1": "3723s", 3 | "duration2": "0.004005006s", 4 | "durationList": [ 5 | "3723s", 6 | "0.004005006s" 7 | ] 8 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInMap#IncellStructInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Item 2 | "map","{int32 ID, int32 Num}Item" 3 | Reward ID,Item info 4 | 1,"1,100" 5 | 2,"2,200" 6 | 3, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInMap#PredefinedStructInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,ItemID,ItemNum 2 | "map",{.Item}int32,int32 3 | Reward ID,Item ID,Item Num 4 | 1,1,10 5 | 2,2,20 6 | 3,, 7 | -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalEnumKeyedList.json: -------------------------------------------------------------------------------- 1 | { 2 | "typeList": [ 3 | "FRUIT_TYPE_APPLE", 4 | "FRUIT_TYPE_ORANGE", 5 | "FRUIT_TYPE_BANANA", 6 | "FRUIT_TYPE_UNKNOWN" 7 | ] 8 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/struct/Struct#PredefinedInCellStruct.csv: -------------------------------------------------------------------------------- 1 | ID,Prop 2 | "map",{base.Property} 3 | Item ID,Item property 4 | 1,"1,Apple,A kind of delicious fruit." 5 | 2,"2,Orange" 6 | 3,3 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#WellKnownTypeDuration.csv: -------------------------------------------------------------------------------- 1 | Duration1,Duration2,Duration 2 | duration,duration,[]duration 3 | Duration 1,Duration 2,Duration 4 | 1h2m3s,4ms5us6ns,"1h2m3s,4ms5us6ns" 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/Scatter2_MetasheetOptionScatter.json: -------------------------------------------------------------------------------- 1 | { 2 | "zoneMap": { 3 | "2": { 4 | "id": 2, 5 | "name": "Desert", 6 | "difficulty": 200 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/conf/default/ScopedTypeReuseStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "item": { 3 | "id": 1, 4 | "name": "Apple" 5 | }, 6 | "reward": { 7 | "id": 2, 8 | "name": "Orange" 9 | } 10 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#FieldPropUnique.csv: -------------------------------------------------------------------------------- 1 | ID,Num 2 | "map|{unique:false}",[]int32 3 | Item ID,Item num 4 | 1,101 5 | 1,102 6 | 1,103 7 | 2,201 8 | 2,202 9 | 3,301 10 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalIncellPdefStructList.csv: -------------------------------------------------------------------------------- 1 | Item1,Item2,Item3,Value 2 | []{.Item},.Item,.Item,int32 3 | Item1 info,Item2 info,Item3 info,Value 4 | "1,100","2,200","3,300",1 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalIncellStructList.csv: -------------------------------------------------------------------------------- 1 | Item1,Item2,Item3 2 | "[]{int32 ID, string Name}Item",Item,Item 3 | Item1 info,Item2 info,Item3 info 4 | "1,Apple","2,Orange","3,Banana" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/misc/TypeReuse#ScopedTypeReuseStruct.csv: -------------------------------------------------------------------------------- 1 | ItemID,ItemName,RewardID,RewardName 2 | {Item}uint32,string,{Reward}uint32,string 3 | Item ID,Item name,Reward ID,Reward name 4 | 1,Apple,2,Orange 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInList#IncellMapInVerticalList.csv: -------------------------------------------------------------------------------- 1 | ID,Props 2 | [Item]uint32,"map" 3 | Item ID,Item props 4 | 1,"1:sour,2:sweet,3:delicious" 5 | 2,"1:sour,2:sweet" 6 | 3,1:sour 7 | -------------------------------------------------------------------------------- /test/functest/conf/default/Scatter1_MetasheetOptionScatter.json: -------------------------------------------------------------------------------- 1 | { 2 | "zoneMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Infinity", 6 | "difficulty": 100 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/conf/default/Scatter1_MetasheetOptionScatter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "zoneMap": { 3 | "10": { 4 | "id": 10, 5 | "name": "Marsh", 6 | "difficulty": 1000 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/conf/default/Scatter3_MetasheetOptionScatter.json: -------------------------------------------------------------------------------- 1 | { 2 | "zoneMap": { 3 | "3": { 4 | "id": 3, 5 | "name": "Snowfield", 6 | "difficulty": 300 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/hero/Hero#FirstVListField.csv: -------------------------------------------------------------------------------- 1 | PropID,PropVal,ItemDesc 2 | [Hero]{Prop}int32,int32,string 3 | Hero prop ID.,Hero prop value.,Hero prop description. 4 | 1,1,hero1 5 | 2,3,hero2 6 | 3,5,hero3 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalIncellPdefStructList2.csv: -------------------------------------------------------------------------------- 1 | Reward1,Reward2,Reward3,Value 2 | []{.Item},.Item,.Item,int32 3 | Item1 info,Item2 info,Item3 info,Value 4 | "1,100","2,200","3,300",1 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInMap#IncellMapInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Props 2 | "map","map" 3 | Item ID,Item props 4 | 1,"1:sour,2:sweet,3:delicious" 5 | 2,"1:sour,2:sweet" 6 | 3,1:sour 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/struct/Struct#CrossCellStruct.csv: -------------------------------------------------------------------------------- 1 | PropertyID,PropertyName,PropertyDesc 2 | {Property}int32,string,string 3 | Property ID,Property Name,Property Description 4 | 1,Orange,A kind of sour fruit. 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/patch/overlays/test/Env.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": YamlPatchConf 2 | Env: test 3 | ScalarList: [10, 20, 30] 4 | StructList: 5 | - ID: 10 6 | Name: snake 7 | - ID: 20 8 | Name: python 9 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/keyedlist/VerticalKeyedList#VerticalStructKeyedList.csv: -------------------------------------------------------------------------------- 1 | ID,PropID,PropName 2 | [Item],"map",string 3 | Item ID,Prop ID,Prop name 4 | 1,1,sweet 5 | 2,1,sweet 6 | 2,2,delicious 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalEnumList.csv: -------------------------------------------------------------------------------- 1 | Param1,Param2,Param3 2 | []enum<.FruitType>,enum<.FruitType>,enum<.FruitType> 3 | Param1 value,Param2 value,Param3 value 4 | 1,FRUIT_TYPE_ORANGE,Banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalUnionList.csv: -------------------------------------------------------------------------------- 1 | Type,Field1,Field2 2 | [.Target]enum<.Target.Type>,union,union 3 | Target type,Target field1,Target field2 4 | Player,1,Mike 5 | Pawn,10, 6 | Boss,200,100 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/union/Union#Target.csv: -------------------------------------------------------------------------------- 1 | Name,Alias,Field1,Field2 2 | Player,Player,"ID 3 | uint32","Name 4 | string" 5 | Pawn,Pawn,"Count 6 | int32", 7 | Boss,Boss,"Health 8 | int32","Attack 9 | int32" 10 | -------------------------------------------------------------------------------- /test/functest/conf/default/dev/YamlPatchConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": "dev", 3 | "strictStruct": { 4 | "id": 0, 5 | "name": "", 6 | "start": "2026-10-01T06:06:06+08:00", 7 | "expiry": "7200s" 8 | } 9 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/enum/Enum#EnumJobType.csv: -------------------------------------------------------------------------------- 1 | Number,Name,Alias 2 | 0,JOB_TYPE_UNKNOWN,Unknown 3 | -1,JOB_TYPE_ALL,All 4 | 10,JOB_TYPE_TEACHER,Teacher 5 | 20,JOB_TYPE_DOCTOR,Doctor 6 | 30,JOB_TYPE_ACCOUNTANT,Accountant 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/VerticalMap#VerticalUnionMap.csv: -------------------------------------------------------------------------------- 1 | Type,Field1,Field2 2 | "map, .Target>",union,union 3 | Target type,Target field1,Target field2 4 | Player,1,Mike 5 | Pawn,10, 6 | Boss,200,100 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/struct/Struct#InCellStruct.csv: -------------------------------------------------------------------------------- 1 | ID,Prop 2 | "map","{int32 ID,string Name,string Desc}Property" 3 | Item ID,Item property 4 | 1,"1,Apple,A kind of delicious fruit." 5 | 2,"2,Orange" 6 | 3,3 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/enum/Enum#Job.csv: -------------------------------------------------------------------------------- 1 | MainJob,ViceJob,AvailableJob 2 | enum<.JobType>,[]enum<.JobType>,"map, int32>" 3 | Main job,Vice job,Vice job 4 | Teacher,"Doctor,Accountant","Doctor:1,Accountant:2,All:3" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Metasheet#Index.csv: -------------------------------------------------------------------------------- 1 | ID,Type,Name,Price 2 | "map",enum<.ItemType>,string,int32 3 | Item ID,Item type,Item name,Item price 4 | 1,Fruit,Apple,40 5 | 2,Fruit,Orange,20 6 | 3,Equip,Sword,10 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInList#IncellStructInVerticalList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,PropID 2 | [Item]uint32,string,"{int32 ID,int64 Value}Prop" 3 | Item ID,Item name,Prop ID 4 | 1,Apple,"1,100" 5 | 2,Orange,"2,200" 6 | 3,Banana, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInList#StructInVerticalList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,PropID,PropValue 2 | [Item]uint32,string,{Prop}int32,int64 3 | Item ID,Item name,Prop ID,Prop value 4 | 1,Apple,1,10 5 | 2,Orange,2,20 6 | 3,Banana,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/xml/patch/overlays/dev/Env.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | base 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/enum/Enum#EnumJobTypeUse.csv: -------------------------------------------------------------------------------- 1 | MainJob,ViceJob,AvailableJob 2 | enum<.JobType>,[]enum<.JobType>,"map, int32>" 3 | Main job,Vice job,Vice job 4 | Teacher,"Doctor,Accountant","Doctor:1,Accountant:2,All:3" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/KeyedListInKeyedList#IncellKListInVerticalKList.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,Tip 2 | [KeyedItem]|{unique:false},string,[] 3 | Item ID,Item desc,Item tip 4 | 1,Apple,"1,2,3" 5 | 1,Banana,"4,5" 6 | 2,Orange,"1,2" 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInList#VerticalListInVerticalKeyedList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,PropID,PropValue 2 | [Item],string,[Prop]int32,int64 3 | Item ID,Item name,Prop ID,Prop value 4 | 1,Apple,1,10 5 | 2,Orange,1,20 6 | 2,Banana,2,30 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInMap#VerticalListInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Name,PropID,PropValue 2 | "map",string,[Prop]int32,int64 3 | Item ID,Item name,Prop ID,Prop value 4 | 1,Apple,1,10 5 | 2,Orange,1,20 6 | 2,Banana,2,30 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInList#VerticalMapInVerticalKeyedList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,PropID,PropValue 2 | [Item],string,"map",int64 3 | Item ID,Item name,Prop ID,Prop value 4 | 1,Apple,1,10 5 | 2,Orange,1,20 6 | 2,Banana,2,30 7 | -------------------------------------------------------------------------------- /internal/importer/testdata/InvalidMeta2.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /test/functest/conf/default/WellKnownTypeDate.json: -------------------------------------------------------------------------------- 1 | { 2 | "beginDate": "2020-01-01T00:00:00+08:00", 3 | "endDate": "2022-10-10T00:00:00+08:00", 4 | "dateList": [ 5 | "2020-01-01T00:00:00+08:00", 6 | "2022-10-10T00:00:00+08:00" 7 | ] 8 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalWrappedUnionList.csv: -------------------------------------------------------------------------------- 1 | TargetType,TargetField1,TargetField2 2 | [Task]{.Target}enum<.Target.Type>,union,union 3 | Target type,Target field1,Target field2 4 | Player,1,Mike 5 | Pawn,10, 6 | Boss,200,100 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalList1.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Flavor 2 | "map",[Reward]string|{optional:true},[Prop]uint32|{optional:true},string 3 | Item ID,Reward name,Prop 1 ID,Prop 1 flavor 4 | 1,Peach,1,sour 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalList2.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Flavor 2 | "map",[Reward]string|{optional:true},[Prop]uint32|{optional:true},string 3 | Item ID,Reward name,Prop 1 ID,Prop 1 flavor 4 | 2,Peach,1,sour 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInMap#IncellListInHMap.csv: -------------------------------------------------------------------------------- 1 | Reward1ID,Reward1Item,Reward2ID,Reward2Item 2 | "map","[]{uint32 ID,int32 Num}Item",uint32,[]Item 3 | Reward1 ID,Reward1 items,Reward2 ID,Reward2 items 4 | 1,"1:10,2:20",2,3:30 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#WellKnownTypeFraction.csv: -------------------------------------------------------------------------------- 1 | MinRatio,Ratio1,Ratio2,Ratio3,Ratio4,Ratio5 2 | fraction,[]fraction,fraction,fraction,fraction,fraction 3 | min ratio,ratio1,ratio 2,ratio 3,ratio 4,ratio 5 4 | 1/4,10%,10‰,10‱,10,0.01 5 | -------------------------------------------------------------------------------- /testdata/unittest/Unittest#IncellMap.csv: -------------------------------------------------------------------------------- 1 | Fruit,Flavor,Item 2 | "map, int64>","map>","map, enum<.FruitFlavor>>" 3 | Fruits,Flavors,Items 4 | "Apple:1,Orange:2","1:Fragrant,2:Sweet","Apple:Fragrant,Orange:Sour" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalPredefinedStructList.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Num,Item2ID,Item2Num,Item3ID,Item3Num 2 | [.Item]int32,int32,int32,int32,int32,int32 3 | Item1 ID,Item1 num,Item2 ID,Item3 num,Item3 ID,Item3 num 4 | 1,100,2,200,3,300 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalStructList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Desc 2 | [Item]uint32,string,string 3 | Item ID,Item name,Item desc 4 | 1,Apple,A kind of delicious fruit. 5 | 2,Orange,A kind of sour fruit. 6 | 3,Banana,A kind of calorie-rich fruit. 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#EnumTypeReuseInBook.csv: -------------------------------------------------------------------------------- 1 | ID,Type,BirdType,Price 2 | "map",enum<.ItemType>,enum<.BirdType>,int32 3 | Item ID,Item type,Bird type,Item price 4 | 1,Fruit,Canary,40 5 | 2,Fruit,Woodpecker,20 6 | 3,Equip,Owl,10 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/KeyedListInKeyedList#VerticalKListInVerticalKList.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,PropID,PropNum 2 | [KeyedItem],string,[Prop],int32 3 | Item ID,Item desc,Prop ID,Prop num 4 | 1,Apple,10,100 5 | 1,Banana,11,110 6 | 2,Orange,20,200 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInMap#IncellMapInHMap.csv: -------------------------------------------------------------------------------- 1 | Reward1ID,Reward1Item,Reward2ID,Reward2Item 2 | "map","map",uint32,"map" 3 | Reward1 ID,Reward1 items,Reward2 ID,Reward2 items 4 | 1,"1:10,2:20",2,3:30 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalExplicitFixedSizeList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | { 8 | "id": 0, 9 | "name": "" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /test/functest/conf/default/YamlScalarConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "num": 10, 4 | "value": "20", 5 | "weight": "30", 6 | "percentage": 0.5, 7 | "ratio": 3.14159, 8 | "name": "apple", 9 | "blob": "VkdGaWJHVmhkUT09", 10 | "ok": true 11 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/HorizontalMap#HorizontalPredefinedStructMap.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Num,Item2ID,Item2Num,Item3ID,Item3Num 2 | "map",int32,int32,int32,int32,int32 3 | Item1 ID,Item1 num,Item2 ID,Item3 num,Item3 ID,Item3 num 4 | 1,100,2,200,3,300 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gomod" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | - package-ecosystem: github-actions 8 | directory: / 9 | schedule: 10 | interval: monthly 11 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalExplicitFixedSizeMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "0": { 4 | "id": 0, 5 | "name": "" 6 | }, 7 | "1": { 8 | "id": 1, 9 | "name": "Apple" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalMap2.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Flavor 2 | "map","map|{optional:true}","map|{optional:true}",string 3 | Item ID,Reward name,Prop 1 ID,Prop 1 flavor 4 | 2,Peach,1,sour 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalStructList.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Item3ID,Item3Name 2 | [Item]uint32,string,uint32,string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Item3 ID,Item3 name 4 | 1,Apple,2,Orange,3,Banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/List#HorizontalExplicitFixedSizeList.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Item3ID,Item3Name 2 | [Item]uint32|{size:2},string,uint32,string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Item3 ID,Item3 name 4 | 1,Apple,,,3,Banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/VerticalMap#VerticalWrappedUnionMap.csv: -------------------------------------------------------------------------------- 1 | ID,TargetType,TargetField1,TargetField2 2 | "map",{.Target}enum<.Target.Type>,union,union 3 | ,Target type,Target field1,Target field2 4 | 1,Player,1,Mike 5 | 2,Pawn,10, 6 | 3,Boss,200,100 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#StructTaskReward.csv: -------------------------------------------------------------------------------- 1 | Name,Type 2 | ID,"uint32|{range: ""1,10""}" 3 | Num,int32 4 | FruitType,enum<.FruitType> 5 | Feature,[]int32 6 | Prop,"map" 7 | Detail,"{enum<.ItemType> Type, string Name, string Desc}Detail" 8 | -------------------------------------------------------------------------------- /internal/confgen/testdata/Metasheet.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalEnumList.json: -------------------------------------------------------------------------------- 1 | { 2 | "typeList": [ 3 | "FRUIT_TYPE_APPLE", 4 | "FRUIT_TYPE_ORANGE", 5 | "FRUIT_TYPE_BANANA", 6 | "FRUIT_TYPE_APPLE", 7 | "FRUIT_TYPE_ORANGE", 8 | "FRUIT_TYPE_APPLE" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/List#HorizontalImplicitFixedSizeList.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Item3ID,Item3Name 2 | [Item]uint32|{fixed:true},string,uint32,string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Item3 ID,Item3 name 4 | 1,Apple,,,3,Banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/HorizontalMap#HorizontalStructMap.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Item3ID,Item3Name 2 | "map",string,uint32,string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Item3 ID,Item3 name 4 | 1,Apple,2,Orange,3,Banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/Map#HorizontalExplicitFixedSizeMap.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Item3ID,Item3Name 2 | "map|{size:2}",string,uint32,string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Item3 ID,Item3 name 4 | 1,Apple,,,3,Banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInList#IncellStructInHorizontaListFF.csv: -------------------------------------------------------------------------------- 1 | Reward1Item,Reward1Name,Reward2Item,Reward2Name 2 | "[Reward]{int32 ID, int32 Num}Item",string,Item,string 3 | Reward1 item,Reward name,Reward2 item,Reward name 4 | "1,10",Lotto,"2,20",Super Lotto 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/struct/Struct#PredefinedCrossCellStruct.csv: -------------------------------------------------------------------------------- 1 | ID,PropID,PropName,PropDesc 2 | "map",{base.Property}int32,string,string 3 | Item ID,Property ID,Property name,Property desc 4 | 1,1,Apple,A kind of delicious fruit. 5 | 2,2,Orange, 6 | 3,3,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/union/Union#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Mode 2 | PredefinedIncellUnion,, 3 | PredefinedUnion,, 4 | UnionFieldCapTarget,FieldCapTarget,MODE_UNION_TYPE 5 | FieldCapUnion,, 6 | UnionTypedTarget,,MODE_UNION_TYPE 7 | TypedUnion,, 8 | Target,,MODE_UNION_TYPE 9 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/Map#HorizontalImplicitFixedSizeMap.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Item3ID,Item3Name 2 | "map|{fixed:true}",string,uint32,string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Item3 ID,Item3 name 4 | 1,Apple,,,3,Banana 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/Map#IncellEnumMap.csv: -------------------------------------------------------------------------------- 1 | Fruit,Flavor,Item 2 | "map, int64>","map>","map, enum<.FruitFlavor>>" 3 | Fruits,Flavors,Items 4 | "Apple:1,Orange:2","1:Fragrant,2:Sweet","Apple:Fragrant,Orange:Sour" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#WellKnownTypeComparator.csv: -------------------------------------------------------------------------------- 1 | MinRatio,Ratio1,Ratio2,Ratio3,Ratio4,Ratio5 2 | comparator,[]comparator,comparator,comparator,comparator,comparator 3 | min ratio,ratio1,ratio 2,ratio 3,ratio 4,ratio 5 4 | !=1/4,<10%,<=10‰,>10‱,>=10,==3/5 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Metasheet#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Transpose,Index,LangOptions,Namerow,Typerow,Noterow,Datarow,Nameline,Typeline,Noteline 2 | Transpose,true,,,,,,,,, 3 | Index,,"ID, (ID,Name)@SpecialItem","Index:cpp go,OrderedMap:cpp",,,,,,, 4 | RowAndLine,,,,1,1,1,2,1,2,3 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalScalarList.json: -------------------------------------------------------------------------------- 1 | { 2 | "paramList": [ 3 | 1, 4 | 2, 5 | 1001 6 | ], 7 | "timeList": [ 8 | "2024-10-01T10:10:10+08:00", 9 | "2025-10-01T10:10:10+08:00", 10 | "2026-10-01T10:10:10+08:00" 11 | ] 12 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInMap#IncellStructListInVMap.csv: -------------------------------------------------------------------------------- 1 | ID,Item,Ticket 2 | "map",[]{.Item},"[]{uint32 ID, int32 Num}Ticket" 3 | ID,Reward items,Reward tickets 4 | 1,"1001:10,1002:20,1003:30","1001:10,1002:20,1003:30" 5 | 2,"2001:10,2002:20","2001:10,2002:20" 6 | -------------------------------------------------------------------------------- /test/functest/conf/default/CrossCellNamedStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardItem": { 3 | "id": 1, 4 | "num": 100 5 | }, 6 | "costItem": { 7 | "id": 2, 8 | "num": 200 9 | }, 10 | "predefinedItem": { 11 | "id": 10, 12 | "num": 20 13 | } 14 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/Test#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Nameline,Typeline,Datarow,Nested,OrderedMap,Sep,AdjacentKey,FieldPresence 2 | Activity,,1,1,4,,true,",",, 3 | Reward,,1,1,4,,,,, 4 | Exchange,ExchangeInfo,2,2,4,,,,, 5 | Match,MatchConf,1,1,4,true,,,,true 6 | Loader,,1,1,5,true,,,true, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptional.csv: -------------------------------------------------------------------------------- 1 | ID,PropID,PropFlavor,PropDuration,PropValue 2 | "map",{Prop}uint32|{optional:true},string|{optional:true},duration|{optional:true},int32 3 | Item ID,Prop ID,Prop flavor,Prop duration,Prop value 4 | 1,10,sour,24h,99 5 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | target: 63% 6 | threshold: 1% 7 | ignore: 8 | - "**/*.pb.go" # ignore all *.pb.go files 9 | - "**/*_generated.go" 10 | - "test" # ignore folders and all its contents 11 | - "internal/tools" 12 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/hero/Hero#VIncellStructList.csv: -------------------------------------------------------------------------------- 1 | Hero,AwardItemId,AwardItemNum,AwardDesc 2 | "[Elem]{int32 Id, int32 Num}Hero",{Award}{Item}int32,int32,string 3 | Hero info.,Award item id,Award item num,Award desc 4 | "1,100",100,1,apple 5 | "2,200",200,2,cherry 6 | "3,300",300,3,banana 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#UniqueFieldInVerticalStructList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Desc 2 | [Item]uint32|{unique:true},string|{unique:true},string 3 | Item ID,Item name,Item desc 4 | 1,Apple,A kind of delicious fruit. 5 | 2,Orange,A kind of sour fruit. 6 | 3,Banana,A kind of calorie-rich fruit. 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInList#HorizontalListInVerticalList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Value,Prop2ID,Prop2Value 2 | [Item]uint32,string,[Prop]int32,int64,int32,int64 3 | Item ID,Item name,Prop1 ID,Prop1 value,Prop2 ID,Prop2 value 4 | 1,Apple,1,10,2,20 5 | 2,Orange,3,30,, 6 | 3,Banana,,,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInMap#HorizontalListInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Value,Prop2ID,Prop2Value 2 | "map",string,[Prop]int32,int64,int32,int64 3 | Item ID,Item name,Prop1 ID,Prop1 value,Prop2 ID,Prop2 value 4 | 1,Apple,1,10,2,20 5 | 2,Orange,3,30,, 6 | 3,Banana,,,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInList#HorizontalMapInVerticalList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Value,Prop2ID,Prop2Value 2 | [Item]uint32,string,"map",int64,int32,int64 3 | Item ID,Item name,Prop1 ID,Prop1 value,Prop2 ID,Prop2 value 4 | 1,Apple,1,10,2,20 5 | 2,Orange,3,30,, 6 | 3,Banana,,,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/patch/overlays/prod/Env.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": YamlPatchConf 2 | Env: prod 3 | ScalarMap: 4 | 10: snake 5 | 20: python 6 | StructMap: 7 | 1: 8 | Num: 100 9 | 20: 10 | Name: pineapple 11 | Num: 200 12 | 30: 13 | Name: durian 14 | Num: 300 15 | -------------------------------------------------------------------------------- /internal/importer/testdata/NotSupportAliasNode.yaml: -------------------------------------------------------------------------------- 1 | "@sheet": "@TABLEAU" 2 | YamlScalarConf: 3 | --- 4 | "@sheet": "@YamlScalarConf" 5 | First occurrence: &anchor Foo 6 | Second occurrence: *anchor 7 | --- 8 | "@sheet": YamlScalarConf 9 | First occurrence: &anchor Foo 10 | Second occurrence: *anchor 11 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInMap#HorizontalMapInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Value,Prop2ID,Prop2Value 2 | "map",string,"map",int64,int32,int64 3 | Item ID,Item name,Prop1 ID,Prop1 value,Prop2 ID,Prop2 value 4 | 1,Apple,1,10,2,20 5 | 2,Orange,3,30,, 6 | 3,Banana,,,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInMap#VerticalMapInVerticalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Name,PropID,PropValue,#IGNORE 2 | "map",string,"map",int64, 3 | Item ID,Item name,Prop ID,Prop value, 4 | 1,Apple,1,10,0 5 | 2,Orange,1,20,false 6 | 2,Banana,2,30,False 7 | 2,Pear,3,40,1 8 | 3,Peach,1,50,TRUE 9 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInList#StructInHorizontaListFF.csv: -------------------------------------------------------------------------------- 1 | Reward1ItemID,Reward1ItemNum,Reward1Name,Reward2ItemID,Reward2ItemNum,Reward2Name 2 | [Reward]{Item}int32,int32,string,int32,int32,string 3 | Item1 ID,Item1 num,Reward name,Item1 ID,Item1 num,Reward name 4 | 1,10,Lotto,10,100,Super Lotto 5 | -------------------------------------------------------------------------------- /internal/importer/testdata/InvalidMeta1.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/hero/Hero#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Nameline,Typeline,Namerow,Typerow,Noterow,Datarow,Merger,Index,OrderedIndex 2 | Hero,,1,1,1,2,3,4,Her*.csv,"Kind,Group@Hero",Kind@Hero 3 | FirstVListField,,1,1,1,2,3,4,,, 4 | FirstHListField,,1,1,1,2,3,4,,, 5 | VIncellStructList,,1,1,1,2,3,4,,, 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalScalarList.csv: -------------------------------------------------------------------------------- 1 | Param1,Param2,Param3,Time1,Time2,Time3 2 | []int32,int32,int32,[]datetime,datetime,datetime 3 | Param1 value,Param2 value,Param3 value,Time1 value,Time2 value,Time3 value 4 | 1,2,1001,2024-10-01 10:10:10,2025-10-01 10:10:10,2026-10-01 10:10:10 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/VerticalMap#VerticalStructMap.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Desc,#IGNORE 2 | "map",string,string, 3 | Item’s ID,Item’s name,Item’s desc, 4 | 1,Apple,A kind of delicious fruit., 5 | 2,Orange,A kind of sour fruit., 6 | 3,Banana,A kind of calorie-rich fruit., 7 | 4,Pear,A kind of sweet fruit.,1 8 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/misc/Note#NoteHorizontalListNesting.csv: -------------------------------------------------------------------------------- 1 | Chapter1ID,Chapter1Section1ID,Chapter1Section1Item1ID,Chapter1Section1Item1Name 2 | [Chapter]uint32,[Chapter]uint32,[Item]uint32,string 3 | Chapter1 ID,Chapter1 section1 ID,Chapter1 section1 item1 ID,Chapter1 section1 item1 name 4 | 1,10,100,Orange 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/union/Union#TypedUnion.csv: -------------------------------------------------------------------------------- 1 | Type,Field1,Field2 2 | [.UnionTypedTarget]enum<.UnionTypedTarget.Type>,union,union 3 | Target type,Target field1,Target field2 4 | Fruit,Orange, 5 | Point,10, 6 | Item,1001,10 7 | Player,1,Tom 8 | Friend,2,Jerry 9 | Monster,2000,100 10 | Boss,20000,200 11 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#WellKnownTypeDatetime.csv: -------------------------------------------------------------------------------- 1 | BeginDatetime,EndDatetime,Datetime 2 | datetime,datetime,[]datetime 3 | Begin datetime,End datetime,Datetime 4 | 2020-01-01 10:25:00,9999-12-31T23:59:59Z,"2020-01-01 10:25:00,2022-10-10 05:10:00,2025-01-01T00:00:00+08:00,2025-01-01T00:00:00Z" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/misc/Acronym.yaml: -------------------------------------------------------------------------------- 1 | # define metasheet: generate all sheets 2 | "@sheet": "@TABLEAU" 3 | --- 4 | # define schema 5 | "@sheet": "@YamlAcronymConf" 6 | InK8s: book 7 | APIV3Spec: string 8 | --- 9 | "@sheet": YamlAcronymConf 10 | InK8s: true 11 | APIV3Spec: https://openai.com/ 12 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/Metasheet#Transpose.csv: -------------------------------------------------------------------------------- 1 | ID,"map",Hero's ID,123,456,789 2 | Name,string,Hero's name,Robin,Superman,Thanos 3 | Desc,string,Hero's description,A big hero!,A small hero!,An evil hero! 4 | Skill,[]int32,Hero's skills,"100,101,102","200,201,202","300,301,302" 5 | #IGNORE,,,,TRUE, 6 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/StructInList#PredefStructInHorizontaListFF.csv: -------------------------------------------------------------------------------- 1 | Reward1ItemID,Reward1ItemNum,Reward1Name,Reward2ItemID,Reward2ItemNum,Reward2Name 2 | [Reward]{.Item}int32,int32,string,int32,int32,string 3 | Item1 ID,Item1 num,Reward name,Item1 ID,Item1 num,Reward name 4 | 1,10,Lotto,10,100,Super Lotto 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "num": 10 6 | }, 7 | { 8 | "id": 2, 9 | "num": 20 10 | }, 11 | { 12 | "id": 3, 13 | "num": 30 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/bench_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | func Benchmark_genProto(b *testing.B) { 6 | for i := 0; i < b.N; i++ { 7 | _ = genProto("ERROR", "SIMPLE") 8 | } 9 | } 10 | 11 | func Benchmark_genConf(b *testing.B) { 12 | for i := 0; i < b.N; i++ { 13 | _ = genConf("ERROR", "SIMPLE") 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellPredefinedStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "num": 10 6 | }, 7 | { 8 | "id": 2, 9 | "num": 20 10 | }, 11 | { 12 | "id": 3, 13 | "num": 30 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/ItemConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | "2": { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | "3": { 12 | "id": 3, 13 | "num": 300 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalIncellStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | { 12 | "id": 3, 13 | "num": 300 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/misc/Note#NoteHorizontalMapNesting.csv: -------------------------------------------------------------------------------- 1 | Chapter1ID,Chapter1Section1ID,Chapter1Section1Item1ID,Chapter1Section1Item1Name 2 | "map","map","map",string 3 | Chapter1 ID,Chapter1 section1 ID,Chapter1 section1 item1 ID,Chapter1 section1 item1 name 4 | 1,10,100,Orange 5 | -------------------------------------------------------------------------------- /testdata/unittest/patchconf/PatchMergeConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "name2": "", 4 | "name3": "", 5 | "time": { 6 | "expiry": "7200s" 7 | }, 8 | "priceList": [ 9 | 20, 10 | 200 11 | ], 12 | "replacePriceList": [ 13 | 20, 14 | 200 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalPredefinedStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | { 12 | "id": 3, 13 | "num": 300 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/struct/Struct#CrossCellNamedStruct.csv: -------------------------------------------------------------------------------- 1 | RewardItemID,RewardItemNum,CostItemID,CostItemNum,PredefinedItemID,PredefinedItemNum 2 | {Item(RewardItem)}int32,int32,{Item(CostItem)}int32,int32,{.Item(PredefinedItem)}int32,int32 3 | Item ID,Item ID,Cost ID,Cost ID,Predefined item ID,Predefined item ID 4 | 1,100,2,200,10,20 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalPredefinedStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | { 12 | "id": 3, 13 | "num": 300 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalIncellPredefStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | { 12 | "id": 3, 13 | "num": 300 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /testdata/unittest/conf/ItemConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | "2": { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | "3": { 12 | "id": 3, 13 | "num": 300 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | { 8 | "id": 2, 9 | "name": "Orange" 10 | }, 11 | { 12 | "id": 3, 13 | "name": "Banana" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /testdata/unittest/invalidconf/ItemConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | "2": { 8 | "id": 2, 9 | "num": 200 10 | } 11 | "3": { 12 | "id": 3, 13 | "num": 300 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/EmptyKeyMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "0": { 4 | "id": 0, 5 | "desc": "Orange" 6 | }, 7 | "1": { 8 | "id": 1, 9 | "desc": "Apple" 10 | }, 11 | "3": { 12 | "id": 3, 13 | "desc": "Banana" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalImplicitFixedSizeList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | { 8 | "id": 0, 9 | "name": "" 10 | }, 11 | { 12 | "id": 3, 13 | "name": "Banana" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalIncellStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | { 8 | "id": 2, 9 | "name": "Orange" 10 | }, 11 | { 12 | "id": 3, 13 | "name": "Banana" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalPredefinedStructMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | "2": { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | "3": { 12 | "id": 3, 13 | "num": 300 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/RowAndLine.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | "2": { 8 | "id": 2, 9 | "name": "Orange" 10 | }, 11 | "3": { 12 | "id": 3, 13 | "name": "Sword" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/UTF8BOM.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": "1", 5 | "name": "Oragne" 6 | }, 7 | "2": { 8 | "id": "2", 9 | "name": "Banana" 10 | }, 11 | "3": { 12 | "id": "3", 13 | "name": "苹果" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalPredefinedStructMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | "2": { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | "3": { 12 | "id": 3, 13 | "num": 300 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/WellKnownTypeDatetime.json: -------------------------------------------------------------------------------- 1 | { 2 | "beginDatetime": "2020-01-01T10:25:00+08:00", 3 | "endDatetime": "9999-12-31T23:59:59Z", 4 | "datetimeList": [ 5 | "2020-01-01T10:25:00+08:00", 6 | "2022-10-10T05:10:00+08:00", 7 | "2025-01-01T00:00:00+08:00", 8 | "2025-01-01T08:00:00+08:00" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/misc/TypeReuse#ScopedTypeReuseListElem.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Reward1ID,Reward1Name,Reward2ID,Reward2Name 2 | [Item]uint32,string,uint32,string,[Item]uint32,string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Reward1 ID,Reward1 name,Reward2 ID,Reward2 name 4 | 1,Apple,2,Orange,3,Banana,4,Watermelon 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/xml/patch/overlays/prod/Env.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | prod 4 | 10:snake,20:python 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/Enum.yaml: -------------------------------------------------------------------------------- 1 | # define metasheet: generate all sheets 2 | "@sheet": "@TABLEAU" 3 | --- 4 | # define schema 5 | "@sheet": "@YamlEnumConf" 6 | ID: uint32 7 | Type: "enum<.FruitType>" 8 | Desc: string 9 | 10 | --- 11 | "@sheet": YamlEnumConf 12 | ID: 1 13 | Type: FRUIT_TYPE_APPLE 14 | Desc: A kind of delicious fruit. 15 | -------------------------------------------------------------------------------- /test/functest/conf/default/EquipConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1000": { 4 | "id": 1000, 5 | "damage": 100 6 | }, 7 | "1001": { 8 | "id": 1001, 9 | "damage": 200 10 | }, 11 | "1002": { 12 | "id": 1002, 13 | "damage": 300 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalIncellPdefStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | { 12 | "id": 3, 13 | "num": 300 14 | } 15 | ], 16 | "value": 1 17 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalIncellPdefStructList2.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "id": 1, 5 | "num": 100 6 | }, 7 | { 8 | "id": 2, 9 | "num": 200 10 | }, 11 | { 12 | "id": 3, 13 | "num": 300 14 | } 15 | ], 16 | "value": 1 17 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalStructMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | "2": { 8 | "id": 2, 9 | "name": "Orange" 10 | }, 11 | "3": { 12 | "id": 3, 13 | "name": "Banana" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /testdata/unittest/conf/ItemConf.txtpb: -------------------------------------------------------------------------------- 1 | item_map: { 2 | key: 1 3 | value: { 4 | id: 1 5 | num: 100 6 | } 7 | } 8 | item_map: { 9 | key: 2 10 | value: { 11 | id: 2 12 | num: 200 13 | } 14 | } 15 | item_map: { 16 | key: 3 17 | value: { 18 | id: 3 19 | num: 300 20 | } 21 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalImplicitFixedSizeMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "0": { 4 | "id": 0, 5 | "name": "" 6 | }, 7 | "1": { 8 | "id": 1, 9 | "name": "Apple" 10 | }, 11 | "3": { 12 | "id": 3, 13 | "name": "Banana" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/conf/default/test/YamlPatchConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": "test", 3 | "scalarList": [ 4 | 10, 5 | 20, 6 | 30 7 | ], 8 | "structList": [ 9 | { 10 | "id": 10, 11 | "name": "snake" 12 | }, 13 | { 14 | "id": 20, 15 | "name": "python" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/misc/TypeReuse#ScopedTypeReuseMapValue.csv: -------------------------------------------------------------------------------- 1 | Item1ID,Item1Name,Item2ID,Item2Name,Reward1ID,Reward1Name,Reward2ID,Reward2Name 2 | "map",string,[uint32,string,"map",string,uint32,string 3 | Item1 ID,Item1 name,Item2 ID,Item2 name,Reward1 ID,Reward1 name,Reward2 ID,Reward2 name 4 | 1,Apple,2,Orange,3,Banana,4,Watermelon 5 | -------------------------------------------------------------------------------- /testdata/unittest/invalidconf/ItemConf.txtpb: -------------------------------------------------------------------------------- 1 | item_map: { 2 | key: 1 3 | value: { 4 | id: 1 5 | num: 100 6 | } 7 | } 8 | item_map: { 9 | key: error 10 | value: { 11 | id: 2 12 | num: 200 13 | } 14 | } 15 | item_map: { 16 | key: 3 17 | value: { 18 | id: 3 19 | num: 300 20 | } 21 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#FieldPropForm.csv: -------------------------------------------------------------------------------- 1 | Transform1,Transform2 2 | {.Transform}|{form:FORM_TEXT},{.Transform}|{form:FORM_JSON} 3 | Box transform1,Box transform2 4 | position:{x:1 y:2 z:3} rotation:{x:4 y:5 z:6} scale:{x:7 y:8 z:9},"{""position"":{""x"":1, ""y"":2, ""z"":3}, ""rotation"":{""x"":4, ""y"":5, ""z"":6}, ""scale"":{""x"":7, ""y"":8, ""z"":9}}" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/VerticalMap#UniqueFieldInVerticalStructMap.csv: -------------------------------------------------------------------------------- 1 | MainID,MainName,SubID,SubName 2 | "map",string|{unique:true},"map",string|{unique:true} 3 | Item main ID,Item main name,Item sub ID,Item sub name 4 | 1001,BackPack,1,Gold 5 | 1001,,2,Diamond 6 | 1001,,3,Ticket 7 | 1001,,4,Point 8 | 1002,Equip,1,Weapon 9 | 1002,,2,Gold 10 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellMapInHMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "itemMap": { 6 | "1": 10, 7 | "2": 20 8 | } 9 | }, 10 | "2": { 11 | "id": 2, 12 | "itemMap": { 13 | "3": 30 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInList#HPredefStructListInHListFF.csv: -------------------------------------------------------------------------------- 1 | Reward1Item1ID,Reward1Item1Num,Reward1Item2ID,Reward1Item2Num,Reward1Name,Reward2Item1ID,Reward2Item1Num,Reward2Name 2 | [Reward][.Item]int32,int32,int32,int32,string,int32,int32,string 3 | Item1 ID,Item1 num,Item2 ID,Item2 num,Reward name,Item1 ID,Item1 num,Reward name 4 | 1,10,2,20,Lotto,10,100,Super Lotto 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInList#HorizontalListInHorizontaListFF.csv: -------------------------------------------------------------------------------- 1 | Reward1Item1ID,Reward1Item1Num,Reward1Item2ID,Reward1Item2Num,Reward1Name,Reward2Item1ID,Reward2Item1Num,Reward2Name 2 | [Reward][Item]int32,int32,int32,int32,string,int32,int32,string 3 | Item1 ID,Item1 num,Item2 ID,Item2 num,Reward name,Item1 ID,Item1 num,Reward name 4 | 1,10,2,20,Lotto,10,100,Super Lotto 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInList#HPredefStructMapInHListFF.csv: -------------------------------------------------------------------------------- 1 | Reward1Item1ID,Reward1Item1Num,Reward1Item2ID,Reward1Item2Num,Reward1Name,Reward2Item1ID,Reward2Item1Num,Reward2Name 2 | "[Reward]map",int32,int32,int32,string,int32,int32,string 3 | Item1 ID,Item1 num,Item2 ID,Item2 num,Reward name,Item1 ID,Item1 num,Reward name 4 | 1,10,2,20,Lotto,10,100,Super Lotto 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalList.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Flavor,Prop2ID,Prop2Flavor,BonusID1,BonusID2 2 | "map",[Reward]string|{optional:true},[Prop]uint32|{optional:true},string,uint32,string,[]uint32|{optional:true},uint32 3 | Item ID,Reward name,Prop 1 ID,Prop 1 flavor,Prop 2 ID,Prop 2 flavor,Bonus ID 1,Bonus ID 2 4 | 1,Apple,1,sour,2,sweet,1,2 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInList#HorizontalMapInHorizontalListFF.csv: -------------------------------------------------------------------------------- 1 | Reward1Item1ID,Reward1Item1Num,Reward1Item2ID,Reward1Item2Num,Reward1Name,Reward2Item1ID,Reward2Item1Num,Reward2Name 2 | "[Reward]map",int32,int32,int32,string,int32,int32,string 3 | Item1 ID,Item1 num,Item2 ID,Item2 num,Reward1 name,Item1 ID,Item1 num,Reward2 name 4 | 1,10,2,20,Lotto,10,100,Super Lotto 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/EnumKeyMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "type": "FRUIT_TYPE_APPLE", 5 | "price": 100 6 | }, 7 | "3": { 8 | "type": "FRUIT_TYPE_ORANGE", 9 | "price": 200 10 | }, 11 | "4": { 12 | "type": "FRUIT_TYPE_BANANA", 13 | "price": 300 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#FieldPropOptionalMap.csv: -------------------------------------------------------------------------------- 1 | ID,Name,Prop1ID,Prop1Flavor,Prop2ID,Prop2Flavor,BonusID 2 | "map","map|{optional:true}","map|{optional:true}",string,uint32,string,"map|{optional:true}" 3 | Item ID,Reward name,Prop 1 ID,Prop 1 flavor,Prop 2 ID,Prop 2 flavor,Bonus ID 1 4 | 1,Apple,1,sour,2,sweet,"1:10,2:20" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#UnionSimpleTarget.csv: -------------------------------------------------------------------------------- 1 | Name,Alias,Field1,Field2,Field3 2 | PVP,AliasPVP,"ID 3 | uint32 4 | Note","Damage 5 | int64 6 | Note","Type 7 | enum<.FruitType> 8 | Note" 9 | PVE,AliasPVE,"Hero 10 | []uint32 11 | Note","Dungeon 12 | map 13 | Note", 14 | Skill,AliasSkill,"StartTime 15 | datetime 16 | Note","Duration 17 | duration 18 | Note", 19 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/misc/SpecialValue.yaml: -------------------------------------------------------------------------------- 1 | # define metasheet: generate all sheets 2 | "@sheet": "@TABLEAU" 3 | --- 4 | # define schema 5 | "@sheet": "@YamlSpecialValueConf" 6 | NameWithSpace: string 7 | IntegerWithFractionalPart: int32 8 | 9 | --- 10 | "@sheet": YamlSpecialValueConf 11 | NameWithSpace: " This is an apple. " 12 | IntegerWithFractionalPart: " 123.456 " 13 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/list/List#FixedList.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,Section1ID,Section2ID,Section3ID,Value1,Value2,Value3,Tip 2 | "map",string,[Section]uint32|{fixed:true},uint32,uint32,[]uint32|{size:2},uint32,uint32,[]|{size:3} 3 | 奖励ID,描述,节1ID,节2ID,节3ID,buff value 1,buff value 2,buff value 3,tips 4 | 1,奖励1,1,2,3,1,2,3,"1,2,3" 5 | 2,奖励2,0,2,,0,2,,"2," 6 | 3,奖励3,1,,,1,,,1 7 | 4,奖励4,,,,,,, 8 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#FieldPropOrder.csv: -------------------------------------------------------------------------------- 1 | ID,Score,Time,Duration 2 | "map",int32|{order:ORDER_DESC},datetime|{order:ORDER_STRICTLY_ASC},duration|{order:ORDER_STRICTLY_DESC} 3 | Player's ID,Player's Score,Player's Time,Player's duration 4 | 1,100,2020-01-01 10:25:00,4m1s 5 | 2,90,2021-01-01 10:25:00,3m1s 6 | 3,90,2022-01-01 10:25:00,2m1s 7 | 4,80,2023-01-01 10:25:00,1m1s 8 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/ListInMap#HorizontalListInHMap.csv: -------------------------------------------------------------------------------- 1 | Reward1ID,Reward1Item1ID,Reward1Item1Num,Reward1Item2ID,Reward1Item2Num,Reward2ID,Reward2Item1ID,Reward2Item1Num 2 | "map",[Item]uint32,int32,uint32,int32,uint32,uint32,int32 3 | Reward1 ID,Reward1 item1 ID,Reward1 item1 num,Reward1 item2 ID,Reward1 item2 num,Reward2 ID,Reward2 item1 ID,Reward2 item1 num 4 | 1,1,10,2,20,2,3,30 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/xml/patch/overlays/test/Env.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | test 4 | 10 5 | 20 6 | 30 7 | 40,50,60 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/nesting/MapInMap#HorizontalMapInHMap.csv: -------------------------------------------------------------------------------- 1 | Reward1ID,Reward1Item1ID,Reward1Item1Num,Reward1Item2ID,Reward1Item2Num,Reward2ID,Reward2Item1ID,Reward2Item1Num 2 | "map","map",int32,uint32,int32,uint32,uint32,int32 3 | Reward1 ID,Reward1 item1 ID,Reward1 item1 num,Reward1 item2 ID,Reward1 item2 num,Reward2 ID,Reward2 item1 ID,Reward2 item1 num 4 | 1,1,10,2,20,2,3,30 5 | -------------------------------------------------------------------------------- /test/functest/proto/default/common/base.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package base; 3 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf/base"; 4 | 5 | import "tableau/protobuf/tableau.proto"; 6 | 7 | message Property { 8 | int32 id = 1 [(tableau.field) = { name: "ID" }]; 9 | string name = 2 [(tableau.field) = { name: "Name" }]; 10 | string desc = 3 [(tableau.field) = { name: "Desc" }]; 11 | } 12 | -------------------------------------------------------------------------------- /internal/importer/testdata/TestTemplate.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | "@sheet": "@TABLEAU" 3 | "#": 4 | Alias: BookAlias 5 | ServiceConf: 6 | Template: true 7 | --- 8 | # define schema 9 | "@sheet": "@ServiceConf" 10 | ID: uint32 11 | Name: string 12 | --- 13 | "@sheet": ServiceConf 14 | ID: {{ env.id }} 15 | Name: {{ env.name}} 16 | {% if env.name == 'prod' %} 17 | Enabled: true 18 | {% else %} 19 | Enabled: false 20 | {% endif %} -------------------------------------------------------------------------------- /test/functest/conf/default/StructInHorizontaListFF.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "item": { 5 | "id": 1, 6 | "num": 10 7 | }, 8 | "name": "Lotto" 9 | }, 10 | { 11 | "item": { 12 | "id": 10, 13 | "num": 100 14 | }, 15 | "name": "Super Lotto" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/Optional#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Merger 2 | FieldPropOptional,"Optional*.csv#FieldPropOptional2,Optional*.csv#FieldPropOptional3" 3 | FieldPropOptionalList,"Optional*.csv#FieldPropOptionalList2,Optional*.csv#FieldPropOptionalList3,Optional*.csv#FieldPropOptionalList4" 4 | FieldPropOptionalMap,"Optional*.csv#FieldPropOptionalMap2,Optional*.csv#FieldPropOptionalMap3,Optional*.csv#FieldPropOptionalMap4" 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#StructType.csv: -------------------------------------------------------------------------------- 1 | Tree,Tree note 2 | Name,Type 3 | ID,uint32 4 | Num,int32 5 | , 6 | Pet,Pet note 7 | Name,Type 8 | Kind,int32 9 | Tip,[]string 10 | , 11 | , 12 | , 13 | FruitShop,FruitShop note 14 | Name,Type 15 | FruitType,enum<.FruitType> 16 | Prop,"map" 17 | , 18 | ColumnDisorderedStruct,ColumnDisorderedStruct note 19 | Type,Name 20 | int32,ID 21 | string,Name 22 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellStructInHorizontaListFF.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "item": { 5 | "id": 1, 6 | "num": 10 7 | }, 8 | "name": "Lotto" 9 | }, 10 | { 11 | "item": { 12 | "id": 2, 13 | "num": 20 14 | }, 15 | "name": "Super Lotto" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/functest/conf/default/PredefStructInHorizontaListFF.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "item": { 5 | "id": 1, 6 | "num": 10 7 | }, 8 | "name": "Lotto" 9 | }, 10 | { 11 | "item": { 12 | "id": 10, 13 | "num": 100 14 | }, 15 | "name": "Super Lotto" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/Test#Exchange.csv: -------------------------------------------------------------------------------- 1 | "id 2 | ID","desc 3 | Desc","begin_time 4 | BeginTime","Date 5 | Date","Time 6 | Time" 7 | "INTEGER 8 | map","VARCHAR(64) 9 | string","datetime 10 | datetime","date 11 | date","time 12 | time" 13 | 奖励ID,描述,开始时间,日期,时间 14 | 1,award1,2020-01-01 05:00:00,2020-01-01,05:00:00 15 | 2,award2,2020-01-01 05:00:00,2020-01-01,05:00:00 16 | 3,award3,2020-01-01 05:00:00,20200101,050000 17 | -------------------------------------------------------------------------------- /test/functest/conf/default/YamlMergerConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "structMap": { 3 | "1": { 4 | "key": 1, 5 | "name": "orange", 6 | "num": 10 7 | }, 8 | "2": { 9 | "key": 2, 10 | "name": "banana", 11 | "num": 20 12 | }, 13 | "100": { 14 | "key": 100, 15 | "name": "apple", 16 | "num": 1000 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#@TABLEAU.csv: -------------------------------------------------------------------------------- 1 | Sheet,Alias,Mode 2 | ItemType,,MODE_ENUM_TYPE 3 | StructTaskReward,TaskReward,MODE_STRUCT_TYPE 4 | UnionTaskTarget,TaskTarget,MODE_UNION_TYPE 5 | UnionSimpleTarget,SimpleTarget,MODE_UNION_TYPE 6 | EnumTypeReuseInBook,, 7 | StructTypeReuseInBook,, 8 | UnionTypeReuseInBook,, 9 | EnumType,,MODE_ENUM_TYPE_MULTI 10 | StructType,,MODE_STRUCT_TYPE_MULTI 11 | UnionType,,MODE_UNION_TYPE_MULTI 12 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/union/Union#PredefinedUnion.csv: -------------------------------------------------------------------------------- 1 | ID,TargetType,TargetField1,TargetField2,TargetField3," Progress" 2 | "map",{union.Target}enum,union,union,union," int32" 3 | ID,Target type,Target field1,Target field2,Target field3," Progress" 4 | 1,PVP,1,10,"Apple,Orange,Banana",3 5 | 2,PVE,"1,100,999","1,2,3","1:10,2:20,3:30",10 6 | 3,Story,"1001,10","1:Apple,2:Orange","Fragrant:1,Sour:2",10 7 | 4,Skill,1,2,,8 8 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalUnionList.csv: -------------------------------------------------------------------------------- 1 | Target1Type,Target1Field1,Target1Field2,Target2Type,Target2Field1,Target2Field2,Target3Type,Target3Field1,Target3Field2 2 | [.Target]enum<.Target.Type>,union,union,enum<.Target.Type>,union,union,enum<.Target.Type>,union,union 3 | Target type,Target field1,Target field2,Target type,Target field1,Target field2,Target type,Target field1,Target field2 4 | Player,1,Mike,Pawn,10,,Boss,200,100 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/HorizontalMap#HorizontalUnionMap.csv: -------------------------------------------------------------------------------- 1 | Target1Type,Target1Field1,Target1Field2,Target2Type,Target2Field1,Target2Field2,Target3Type,Target3Field1,Target3Field2 2 | "map, .Target>",union,union,enum<.Target.Type>,union,union,enum<.Target.Type>,union,union 3 | Target type,Target field1,Target field2,Target type,Target field1,Target field2,Target type,Target field1,Target field2 4 | Player,1,Mike,Pawn,10,,Boss,200,100 5 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/metasheet/YamlScatter.yaml: -------------------------------------------------------------------------------- 1 | # define metasheet: generate all sheets 2 | "@sheet": "@TABLEAU" 3 | "YamlScatterConf": 4 | Scatter: "YamlScatter*.yaml" 5 | --- 6 | # define schema 7 | "@sheet": "@YamlScatterConf" 8 | StrictStruct: 9 | "@type": "{Fruit}" 10 | "@struct": 11 | ID: uint32 12 | Name: string 13 | --- 14 | "@sheet": YamlScatterConf 15 | StrictStruct: 16 | ID: 100 17 | Name: apple 18 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/metasheet/Merger.yaml: -------------------------------------------------------------------------------- 1 | # define metasheet: generate all sheets 2 | "@sheet": "@TABLEAU" 3 | "YamlMergerConf": 4 | Merger: "Merger*.yaml" 5 | --- 6 | # define schema 7 | "@sheet": "@YamlMergerConf" 8 | StructMap: 9 | "@type": "map" 10 | "@struct": 11 | Name: string 12 | Num: int32 13 | --- 14 | "@sheet": YamlMergerConf 15 | StructMap: 16 | 100: 17 | Name: apple 18 | Num: 1000 19 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalIncellInStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskList": [ 3 | { 4 | "paramList": [ 5 | 1 6 | ] 7 | }, 8 | { 9 | "paramList": [ 10 | 2, 11 | 3 12 | ] 13 | }, 14 | { 15 | "paramList": [ 16 | 4, 17 | 5, 18 | 6 19 | ] 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /test/functest/conf/default/test/XmlPatchConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": "test", 3 | "scalarListList": [ 4 | 10, 5 | 20, 6 | 30 7 | ], 8 | "incellScalarListList": [ 9 | 40, 10 | 50, 11 | 60 12 | ], 13 | "structListList": [ 14 | { 15 | "id": 10, 16 | "name": "snake" 17 | }, 18 | { 19 | "id": 20, 20 | "name": "python" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/wellknown/WellKnown#WellKnownTypeVersion.csv: -------------------------------------------------------------------------------- 1 | Version,CustomVersion,IncellVersion,HorizontalVersion1,HorizontalVersion2,HorizontalVersion3 2 | version,"version|{pattern:""99.999.99.999.99.999""}","[]version|{pattern:""999.999.999""}","[]version|{pattern:""999.999.999""}",version,version 3 | default version,custom version,incell version,horizontal version1,horizontal version2,horizontal version3 4 | 1.0.3,1.2.3.4.5.6,"1.2.3,4.5.6",1.0.0,1.2.3,2.0.3 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/ScopedTypeReuseListElem.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | { 8 | "id": 2, 9 | "name": "Orange" 10 | } 11 | ], 12 | "rewardList": [ 13 | { 14 | "id": 3, 15 | "name": "Banana" 16 | }, 17 | { 18 | "id": 4, 19 | "name": "Watermelon" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/hero/Hero#Hero.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,Kind,Group,Property1ID,Property1Value,Property2ID,Property2Value,AwardItemID,AwardItemNum 2 | "map",string,int32,int32,"map",int64,int32,int64,{.Item}int32,int32 3 | Hero ID.,Hero description.,Hero kind.,Hero group.,Hero prop ID.,Hero prop value.,Hero prop ID.,Hero prop value.,Hero award ID.,Hero award num. 4 | 1,hero1,1,10,1,10,2,20,1,10 5 | 2,hero2,1,11,3,30,4,40,2,11 6 | 3,hero3,2,22,5,50,,,3,12 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalColumnSkippedList.csv: -------------------------------------------------------------------------------- 1 | ID,Prop1ID,Prop1Name,Prop1Value,NotPrefixProp1Price,Prop2ID,NotPrefixProp2Name,Prop2Value,Prop2Price 2 | "map",[Prop]int32,,int32,,int32,,int32, 3 | Item's ID,Prop1 ID,Prop1 name (skipped),Prop1 value,Prop1 price (skipped),Prop2 ID,Prop2 name (skipped),Prop2 value,Prop2 price (skipped) 4 | 1,1,Apple,100,40,2,Orange,200,30 5 | 2,3,Banana,300,20,4,Pomelo,400,20 6 | 3,5,Watermelon,500,100,,,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/HorizontalMap#HorizontalColumnSkippedMap.csv: -------------------------------------------------------------------------------- 1 | ID,Prop1ID,Prop1Name,Prop1Value,NotPrefixProp1Price,Prop2ID,NotPrefixProp2Name,Prop2Value,Prop2Price 2 | "map","map",,int32,,int32,,int32, 3 | Item ID,Prop1 ID,Prop1 name (skipped),Prop1 value,Prop1 price (skipped),Prop2 ID,Prop2 name (skipped),Prop2 value,Prop2 price (skipped) 4 | 1,1,Apple,100,40,2,Orange,200,30 5 | 2,3,Banana,300,20,4,Pomelo,400,20 6 | 3,5,Watermelon,500,100,,,, 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/hero/HeroA#Hero.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,Kind,Group,Property1ID,Property1Value,Property2ID,Property2Value,AwardItemID,AwardItemNum 2 | "map",string,int32,int32,"map",int64,int32,int64,{.Item}int32,int32 3 | Hero ID.,Hero description.,Hero kind.,Hero group.,Hero prop ID.,Hero prop value.,Hero prop ID.,Hero prop value.,Hero award ID.,Hero award num. 4 | 10,hero10,1,10,1,10,2,20,1,10 5 | 20,hero20,1,11,3,30,4,40,2,11 6 | 30,hero30,2,22,5,50,,,3,12 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/hero/HeroB#Hero.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,Kind,Group,Property1ID,Property1Value,Property2ID,Property2Value,AwardItemID,AwardItemNum 2 | "map",string,int32,int32,"map",int64,int32,int64,{.Item}int32,int32 3 | Hero ID.,Hero description.,Hero kind.,Hero group.,Hero prop ID.,Hero prop value.,Hero prop ID.,Hero prop value.,Hero award ID.,Hero award num. 4 | 100,hero100,1,10,1,10,2,20,1,10 5 | 200,hero200,1,11,3,30,4,40,2,11 6 | 300,hero300,2,22,5,50,,,3,12 7 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#FieldPropSep.csv: -------------------------------------------------------------------------------- 1 | ID,Number,Value,Tip,Item,Prop 2 | "map","[]int32|{sep:""!""}","[]int32|{sep:""!!""}","map|{sep:"";"" subsep:""=""}","{uint32 ID, int32 Num}Item|{sep:"":""}","[]{uint32 ID, int32 Value}Prop|{sep:"";"" subsep:""=""}" 3 | ID,Numbers,Values,Tips,Item,Props 4 | 1,1!2!3,1!!2!!3,dog=cute;bird=noisy,1:100,1=100;2=200;3=300 5 | 2,300!400!500,300!!400!!500,apple=sweet;banana=long;orange=jucy,2:200,4=400;5=500 6 | -------------------------------------------------------------------------------- /test/functest/conf/default/NoteHorizontalListNesting.json: -------------------------------------------------------------------------------- 1 | { 2 | "chapterList": [ 3 | { 4 | "id": 1, 5 | "sectionList": [ 6 | { 7 | "id": 10, 8 | "itemList": [ 9 | { 10 | "id": 100, 11 | "name": "Orange" 12 | } 13 | ] 14 | } 15 | ] 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/functest/conf/default/ScopedTypeReuseMapValue.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple" 6 | }, 7 | "2": { 8 | "id": 2, 9 | "name": "Orange" 10 | } 11 | }, 12 | "rewardMap": { 13 | "3": { 14 | "id": 3, 15 | "name": "Banana" 16 | }, 17 | "4": { 18 | "id": 4, 19 | "name": "Watermelon" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/HorizontalList#HorizontalWrappedUnionList.csv: -------------------------------------------------------------------------------- 1 | Task1TargetType,Task1TargetField1,Task1TargetField2,Task2TargetType,Task2TargetField1,Task2TargetField2,Task3TargetType,Task3TargetField1,Task3TargetField2 2 | [Task]{.Target}enum<.Target.Type>,union,union,enum<.Target.Type>,union,union,enum<.Target.Type>,union,union 3 | Target type,Target field1,Target field2,Target type,Target field1,Target field2,Target type,Target field1,Target field2 4 | Player,1,Mike,Pawn,10,,Boss,200,100 5 | -------------------------------------------------------------------------------- /testdata/unittest/patchconf2/PatchMergeConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "num": 99 6 | }, 7 | "999": { 8 | "id": 999, 9 | "num": 99900 10 | } 11 | }, 12 | "replaceItemMap": { 13 | "1": { 14 | "id": 1, 15 | "num": 99 16 | }, 17 | "999": { 18 | "id": 999, 19 | "num": 99900 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/functest/conf/default/StructInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "item": { 6 | "id": 1, 7 | "num": 10 8 | } 9 | }, 10 | "2": { 11 | "id": 2, 12 | "item": { 13 | "id": 2, 14 | "num": 20 15 | } 16 | }, 17 | "3": { 18 | "id": 3, 19 | "item": null 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "desc": "A kind of delicious fruit." 7 | }, 8 | { 9 | "id": 2, 10 | "name": "Orange", 11 | "desc": "A kind of sour fruit." 12 | }, 13 | { 14 | "id": 3, 15 | "name": "Banana", 16 | "desc": "A kind of calorie-rich fruit." 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellStructInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "item": { 6 | "id": 1, 7 | "num": 100 8 | } 9 | }, 10 | "2": { 11 | "id": 2, 12 | "item": { 13 | "id": 2, 14 | "num": 200 15 | } 16 | }, 17 | "3": { 18 | "id": 3, 19 | "item": null 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/functest/conf/default/NoteHorizontalMapNesting.json: -------------------------------------------------------------------------------- 1 | { 2 | "chapterMap": { 3 | "1": { 4 | "id": 1, 5 | "sectionMap": { 6 | "10": { 7 | "id": 10, 8 | "itemMap": { 9 | "100": { 10 | "id": 100, 11 | "name": "Orange" 12 | } 13 | } 14 | } 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /test/functest/conf/default/PredefinedStructInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "item": { 6 | "id": 1, 7 | "num": 10 8 | } 9 | }, 10 | "2": { 11 | "id": 2, 12 | "item": { 13 | "id": 2, 14 | "num": 20 15 | } 16 | }, 17 | "3": { 18 | "id": 3, 19 | "item": null 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /testdata/unittest/patchconf2/PatchMergeConf.txtpb: -------------------------------------------------------------------------------- 1 | item_map: { 2 | key: 1 3 | value: { 4 | id: 1 5 | num: 99 6 | } 7 | } 8 | item_map: { 9 | key: 999 10 | value: { 11 | id: 999 12 | num: 99900 13 | } 14 | } 15 | replace_item_map: { 16 | key: 1 17 | value: { 18 | id: 1 19 | num: 99 20 | } 21 | } 22 | replace_item_map: { 23 | key: 999 24 | value: { 25 | id: 999 26 | num: 99900 27 | } 28 | } -------------------------------------------------------------------------------- /test/functest/conf/default/UniqueFieldInVerticalStructList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "desc": "A kind of delicious fruit." 7 | }, 8 | { 9 | "id": 2, 10 | "name": "Orange", 11 | "desc": "A kind of sour fruit." 12 | }, 13 | { 14 | "id": 3, 15 | "name": "Banana", 16 | "desc": "A kind of calorie-rich fruit." 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalStructMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple", 6 | "desc": "A kind of delicious fruit." 7 | }, 8 | "2": { 9 | "id": 2, 10 | "name": "Orange", 11 | "desc": "A kind of sour fruit." 12 | }, 13 | "3": { 14 | "id": 3, 15 | "name": "Banana", 16 | "desc": "A kind of calorie-rich fruit." 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellKListInVerticalKList.json: -------------------------------------------------------------------------------- 1 | { 2 | "keyedItemList": [ 3 | { 4 | "id": 1, 5 | "desc": "Apple", 6 | "tipList": [ 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5 12 | ] 13 | }, 14 | { 15 | "id": 2, 16 | "desc": "Orange", 17 | "tipList": [ 18 | 1, 19 | 2 20 | ] 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/functest/conf/default/prod/YamlPatchConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": "prod", 3 | "scalarMap": { 4 | "10": "snake", 5 | "20": "python" 6 | }, 7 | "structMap": { 8 | "1": { 9 | "key": 1, 10 | "num": 100 11 | }, 12 | "20": { 13 | "key": 20, 14 | "name": "pineapple", 15 | "num": 200 16 | }, 17 | "30": { 18 | "key": 30, 19 | "name": "durian", 20 | "num": 300 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /test/functest/conf/default/EnumJobTypeUse.json: -------------------------------------------------------------------------------- 1 | { 2 | "mainJob": "JOB_TYPE_TEACHER", 3 | "viceJobList": [ 4 | "JOB_TYPE_DOCTOR", 5 | "JOB_TYPE_ACCOUNTANT" 6 | ], 7 | "availableJobMap": { 8 | "-1": { 9 | "key": "JOB_TYPE_ALL", 10 | "value": 3 11 | }, 12 | "20": { 13 | "key": "JOB_TYPE_DOCTOR", 14 | "value": 1 15 | }, 16 | "30": { 17 | "key": "JOB_TYPE_ACCOUNTANT", 18 | "value": 2 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellListInVerticalList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "propList": [ 6 | 10, 7 | 20, 8 | 30 9 | ] 10 | }, 11 | { 12 | "id": 2, 13 | "propList": [ 14 | 10, 15 | 20 16 | ] 17 | }, 18 | { 19 | "id": 3, 20 | "propList": [ 21 | 10 22 | ] 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/prod/XmlPatchConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": "prod", 3 | "scalarMapMap": { 4 | "10": "snake", 5 | "20": "python" 6 | }, 7 | "structMapMap": { 8 | "1": { 9 | "key": 1, 10 | "num": 100 11 | }, 12 | "20": { 13 | "key": 20, 14 | "name": "pineapple", 15 | "num": 200 16 | }, 17 | "30": { 18 | "key": 30, 19 | "name": "durian", 20 | "num": 300 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /test/functest/conf/default/FieldPropUnique.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "numList": [ 6 | 101, 7 | 102, 8 | 103 9 | ] 10 | }, 11 | "2": { 12 | "id": 2, 13 | "numList": [ 14 | 201, 15 | 202 16 | ] 17 | }, 18 | "3": { 19 | "id": 3, 20 | "numList": [ 21 | 301 22 | ] 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellListInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "propList": [ 6 | 10, 7 | 20, 8 | 30 9 | ] 10 | }, 11 | "2": { 12 | "id": 2, 13 | "propList": [ 14 | 10, 15 | 20 16 | ] 17 | }, 18 | "3": { 19 | "id": 3, 20 | "propList": [ 21 | 10 22 | ] 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/Index.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "type": "ITEM_TYPE_FRUIT", 6 | "name": "Apple", 7 | "price": 40 8 | }, 9 | "2": { 10 | "id": 2, 11 | "type": "ITEM_TYPE_FRUIT", 12 | "name": "Orange", 13 | "price": 20 14 | }, 15 | "3": { 16 | "id": 3, 17 | "type": "ITEM_TYPE_EQUIP", 18 | "name": "Sword", 19 | "price": 10 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/map/HorizontalMap#HorizontalWrappedUnionMap.csv: -------------------------------------------------------------------------------- 1 | Task1ID,Task1TargetType,Task1TargetField1,Task1TargetField2,Task2ID,Task2TargetType,Task2TargetField1,Task2TargetField2,Task3ID,Task3TargetType,Task3TargetField1,Task3TargetField2 2 | "map",{.Target}enum<.Target.Type>,union,union,int32,enum<.Target.Type>,union,union,int32,enum<.Target.Type>,union,union 3 | ID,Target type,Target field1,Target field2,ID,Target type,Target field1,Target field2,ID,Target type,Target field1,Target field2 4 | 1,Player,1,Mike,2,Pawn,10,,3,Boss,200,100 5 | -------------------------------------------------------------------------------- /docs/dev.md: -------------------------------------------------------------------------------- 1 | ## golangci-lint 2 | 3 | ### 1. Install golangci-lint 4 | 5 | ```bash 6 | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6 7 | 8 | golangci-lint --version 9 | ``` 10 | 11 | See https://golangci-lint.run/welcome/install/#local-installation 12 | 13 | ### 2. Lint 14 | 15 | ```bash 16 | golangci-lint run 17 | 18 | # You can choose which directories or files to analyze: 19 | golangci-lint run dir1 dir2/... 20 | golangci-lint run file1.go 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /log/options.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | type Options struct { 4 | // Log mode: SIMPLE, FULL. 5 | // 6 | // Default: "FULL". 7 | Mode string 8 | // Log level: DEBUG, INFO, WARN, ERROR. 9 | // 10 | // Default: "INFO". 11 | Level string 12 | // Log filename: set this if you want to write log messages to files. 13 | // 14 | // Default: "". 15 | Filename string 16 | // Log sink: CONSOLE, FILE, and MULTI. 17 | // 18 | // Default: "CONSOLE". 19 | Sink string 20 | } 21 | 22 | const ( 23 | ModeSimple = "SIMPLE" 24 | ModeFull = "FULL" 25 | ) 26 | -------------------------------------------------------------------------------- /test/functest/testdata/default/yaml/Scalar.yaml: -------------------------------------------------------------------------------- 1 | # define metasheet: generate all sheets 2 | "@sheet": "@TABLEAU" 3 | --- 4 | # define schema 5 | "@sheet": "@YamlScalarConf" 6 | ID: uint32 7 | Num: int32 8 | Value: uint64 9 | Weight: int64 10 | Percentage: float 11 | Ratio: double 12 | Name: string 13 | Blob: bytes 14 | OK: bool 15 | 16 | --- 17 | "@sheet": YamlScalarConf 18 | ID: 1 19 | Num: 10 20 | Value: 20 21 | Weight: 30 22 | Percentage: 0.5 23 | Ratio: 3.14159 24 | Name: apple 25 | Blob: "VGFibGVhdQ==" # base64 of "Tableau" 26 | OK: true 27 | -------------------------------------------------------------------------------- /scripts/gen_pb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # set -eux 4 | set -e 5 | set -o pipefail 6 | 7 | cd "$(git rev-parse --show-toplevel)" 8 | 9 | PROTO_PATH="./proto" 10 | TABLEAU_INDIR="${PROTO_PATH}/tableau/protobuf" 11 | TABLEAU_OUTDIR="./proto/tableaupb" 12 | 13 | # remove generated files 14 | rm -rfv $TABLEAU_OUTDIR/*.pb.go $TABLEAU_OUTDIR/**/*.pb.go 15 | 16 | protoc \ 17 | --go_out="$TABLEAU_OUTDIR" \ 18 | --go_opt=module="github.com/tableauio/tableau/proto/tableaupb" \ 19 | --proto_path="$PROTO_PATH" \ 20 | "$TABLEAU_INDIR"/*.proto "$TABLEAU_INDIR"/**/*.proto 21 | -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalUnionList.json: -------------------------------------------------------------------------------- 1 | { 2 | "targetList": [ 3 | { 4 | "type": "TYPE_PLAYER", 5 | "player": { 6 | "id": 1, 7 | "name": "Mike" 8 | } 9 | }, 10 | { 11 | "type": "TYPE_PAWN", 12 | "pawn": { 13 | "count": 10 14 | } 15 | }, 16 | { 17 | "type": "TYPE_BOSS", 18 | "boss": { 19 | "health": 200, 20 | "attack": 100 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /test/functest/conf/default/WellKnownTypeFraction.json: -------------------------------------------------------------------------------- 1 | { 2 | "minRatio": { 3 | "num": 1, 4 | "den": 4 5 | }, 6 | "ratioList": [ 7 | { 8 | "num": 10, 9 | "den": 100 10 | }, 11 | { 12 | "num": 10, 13 | "den": 1000 14 | }, 15 | { 16 | "num": 10, 17 | "den": 10000 18 | }, 19 | { 20 | "num": 10, 21 | "den": 1 22 | }, 23 | { 24 | "num": 1, 25 | "den": 100 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/union/Union#UnionFieldCapTarget.csv: -------------------------------------------------------------------------------- 1 | Number,Name,Alias,Field1,Field2,Field3,Field4,Field5,Field6 2 | 101,Exchange,Exchange,"ID 3 | uint32","Cost 4 | [].Item|{cross:3}",,,"Gain 5 | [].Item|{cross:-1}", 6 | 102,Vote,Vote,"Approves 7 | []uint32|{cross:2}",,"Againsts 8 | []uint32|{cross:1}","Abstains 9 | []uint32|{cross:2}",, 10 | 103,Fruit2V2,Fruit,"TypeA 11 | []enum<.FruitType>|{cross:3}",,,"TypeB 12 | []enum<.FruitType>","Flavor 13 | []enum<.FruitFlavor>|{cross:-1}", 14 | 104,Key3V3,Key,"Keys 15 | []|{cross:3}",,,"Values 16 | []int32|{cross:-1}",, 17 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/union/Union#UnionTypedTarget.csv: -------------------------------------------------------------------------------- 1 | Name,Alias,Type,Field1,Field2,Field3,#Note 2 | Fruit,Fruit,enum<.FruitType>,,,,Bound to predefined enum 3 | Point,Point,int32,,,,Bound to scalar 4 | Item,Item,.Item,,,,Bound to predefined struct 5 | Player,Player,,"ID 6 | uint32","Name 7 | string",,Bound to locally defined struct 8 | Friend,Friend,Player,,,,Bound to reused struct 9 | Monster,Monster,CustomMonster,"Health 10 | int32","Attack 11 | int32",,Bound to locally defined struct with custom name 12 | Boss,Boss,CustomMonster,,,,Bound to reused struct with custom name 13 | -------------------------------------------------------------------------------- /test/functest/conf/default/FirstVListField.json: -------------------------------------------------------------------------------- 1 | { 2 | "heroList": [ 3 | { 4 | "prop": { 5 | "id": 1, 6 | "val": 1 7 | }, 8 | "itemDesc": "hero1" 9 | }, 10 | { 11 | "prop": { 12 | "id": 2, 13 | "val": 3 14 | }, 15 | "itemDesc": "hero2" 16 | }, 17 | { 18 | "prop": { 19 | "id": 3, 20 | "val": 5 21 | }, 22 | "itemDesc": "hero3" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalUnionList.json: -------------------------------------------------------------------------------- 1 | { 2 | "targetList": [ 3 | { 4 | "type": "TYPE_PLAYER", 5 | "player": { 6 | "id": 1, 7 | "name": "Mike" 8 | } 9 | }, 10 | { 11 | "type": "TYPE_PAWN", 12 | "pawn": { 13 | "count": 10 14 | } 15 | }, 16 | { 17 | "type": "TYPE_BOSS", 18 | "boss": { 19 | "health": 200, 20 | "attack": 100 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /test/functest/conf/default/StructInVerticalList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "prop": { 7 | "id": 1, 8 | "value": "10" 9 | } 10 | }, 11 | { 12 | "id": 2, 13 | "name": "Orange", 14 | "prop": { 15 | "id": 2, 16 | "value": "20" 17 | } 18 | }, 19 | { 20 | "id": 3, 21 | "name": "Banana", 22 | "prop": null 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/Transpose.json: -------------------------------------------------------------------------------- 1 | { 2 | "heroMap": { 3 | "123": { 4 | "id": 123, 5 | "name": "Robin", 6 | "desc": "A big hero!", 7 | "skillList": [ 8 | 100, 9 | 101, 10 | 102 11 | ] 12 | }, 13 | "789": { 14 | "id": 789, 15 | "name": "Thanos", 16 | "desc": "An evil hero!", 17 | "skillList": [ 18 | 300, 19 | 301, 20 | 302 21 | ] 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#FieldPropSequence.csv: -------------------------------------------------------------------------------- 1 | DungeonID,DungeonName,ChapterID,ChapterDifficulty,SectionID,SectionAward 2 | "map",string,"map|{sequence:1}",int32,"map|{sequence:1}",{.Item} 3 | ,,,,, 4 | 1000,MoonLake,1,10,1,"10001,1" 5 | 1000,MoonLake,1,10,2,"10002,2" 6 | 1000,MoonLake,1,10,3,"10003,3" 7 | 1000,MoonLake,2,10,1,"10011,1" 8 | 1000,MoonLake,2,10,2,"10012,2" 9 | 1001,BabelTower,1,10,1,"20001,1" 10 | 1001,BabelTower,1,10,2,"20002,2" 11 | 1001,BabelTower,2,10,1,"20011,1" 12 | 1001,BabelTower,2,10,2,"20012,2" 13 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalUnionMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "targetMap": { 3 | "1": { 4 | "type": "TYPE_PLAYER", 5 | "player": { 6 | "id": 1, 7 | "name": "Mike" 8 | } 9 | }, 10 | "2": { 11 | "type": "TYPE_PAWN", 12 | "pawn": { 13 | "count": 10 14 | } 15 | }, 16 | "3": { 17 | "type": "TYPE_BOSS", 18 | "boss": { 19 | "health": 200, 20 | "attack": 100 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellMapInVerticalList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "propsMap": { 6 | "1": "sour", 7 | "2": "sweet", 8 | "3": "delicious" 9 | } 10 | }, 11 | { 12 | "id": 2, 13 | "propsMap": { 14 | "1": "sour", 15 | "2": "sweet" 16 | } 17 | }, 18 | { 19 | "id": 3, 20 | "propsMap": { 21 | "1": "sour" 22 | } 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalUnionMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "targetMap": { 3 | "1": { 4 | "type": "TYPE_PLAYER", 5 | "player": { 6 | "id": 1, 7 | "name": "Mike" 8 | } 9 | }, 10 | "2": { 11 | "type": "TYPE_PAWN", 12 | "pawn": { 13 | "count": 10 14 | } 15 | }, 16 | "3": { 17 | "type": "TYPE_BOSS", 18 | "boss": { 19 | "health": 200, 20 | "attack": 100 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/functest/conf/default/MetasheetOptionMerger.json: -------------------------------------------------------------------------------- 1 | { 2 | "zoneMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Infinity", 6 | "difficulty": 100 7 | }, 8 | "2": { 9 | "id": 2, 10 | "name": "Desert", 11 | "difficulty": 200 12 | }, 13 | "3": { 14 | "id": 3, 15 | "name": "Snowfield", 16 | "difficulty": 300 17 | }, 18 | "10": { 19 | "id": 10, 20 | "name": "Marsh", 21 | "difficulty": 1000 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/xml/metasheet/Merger2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /internal/strcase/context.go: -------------------------------------------------------------------------------- 1 | package strcase 2 | 3 | import ( 4 | "context" 5 | ) 6 | 7 | type ctxKey struct{} 8 | 9 | // NewContext creates a new context with the given Strcase. 10 | func NewContext(ctx context.Context, v *Strcase) context.Context { 11 | return context.WithValue(ctx, ctxKey{}, v) 12 | } 13 | 14 | // FromContext returns the Strcase from the given context. If not found, it will 15 | // return the default Strcase. 16 | func FromContext(ctx context.Context) *Strcase { 17 | if v, ok := ctx.Value(ctxKey{}).(*Strcase); ok { 18 | return v 19 | } 20 | return &Strcase{} 21 | } 22 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellStructInVerticalList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "propId": { 7 | "id": 1, 8 | "value": "100" 9 | } 10 | }, 11 | { 12 | "id": 2, 13 | "name": "Orange", 14 | "propId": { 15 | "id": 2, 16 | "value": "200" 17 | } 18 | }, 19 | { 20 | "id": 3, 21 | "name": "Banana", 22 | "propId": null 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/IncellMapInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "propsMap": { 6 | "1": "sour", 7 | "2": "sweet", 8 | "3": "delicious" 9 | } 10 | }, 11 | "2": { 12 | "id": 2, 13 | "propsMap": { 14 | "1": "sour", 15 | "2": "sweet" 16 | } 17 | }, 18 | "3": { 19 | "id": 3, 20 | "propsMap": { 21 | "1": "sour" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#StructTypeReuseInBook.csv: -------------------------------------------------------------------------------- 1 | ID,PetKind,PetTip,TaskRewardID,TaskRewardNum,TaskRewardFruitType,TaskRewardFeature,TaskRewardProp,TaskRewardDetail 2 | "map",{.Pet}int32,[]string,{.TaskReward}uint32,int32,enum<.FruitType>,[]int32,"map","{enum<.ItemType> Type, string Name, string Desc}Detail" 3 | Reward ID,Pet kind,Pet's tip,Reward ID,Reward num,Reward fruit type,Reward feature,Reward Prop,Reward Detail 4 | 1,1,"lovely,small",1,100,Apple,"1,2","1:Power,2:Skill","Equip,Sword,Sword's Desc" 5 | 2,2,"beautiful,big",2,200,Banana,1,1:Power, 6 | 3,3,,3,300,,,, 7 | -------------------------------------------------------------------------------- /test/functest/conf/default/EnumTypeReuseInBook.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "type": "ITEM_TYPE_FRUIT", 6 | "birdType": "BIRD_TYPE_CANARY", 7 | "price": 40 8 | }, 9 | "2": { 10 | "id": 2, 11 | "type": "ITEM_TYPE_FRUIT", 12 | "birdType": "BIRD_TYPE_WOODPECKER", 13 | "price": 20 14 | }, 15 | "3": { 16 | "id": 3, 17 | "type": "ITEM_TYPE_EQUIP", 18 | "birdType": "BIRD_TYPE_OWL", 19 | "price": 10 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#EnumType.csv: -------------------------------------------------------------------------------- 1 | CatType,CatType note, 2 | Number,Name,Alias 3 | 1,CAT_TYPE_RAGDOLL,Ragdoll 4 | 2,CAT_TYPE_PERSIAN,Persian 5 | 3,CAT_TYPE_SPHYNX,Sphynx 6 | ,, 7 | DogType,DogType note, 8 | Number,Name,Alias 9 | 1,DOG_TYPE_POODLE,Poodle 10 | 2,DOG_TYPE_BULLDOG,Bulldog 11 | 3,DOG_TYPE_DACHSHUND,Dachshund 12 | ,, 13 | ,, 14 | ,, 15 | BirdType,BirdType note, 16 | Number,Name,Alias 17 | 1,CANARY,Canary 18 | 2,WOODPECKER,Woodpecker 19 | 3,OWL,Owl 20 | ,, 21 | ColumnDisorderedEnum,ColumnDisorderedEnum note, 22 | Alias,Number,Name 23 | Large,1,LARGE 24 | Medium,2,MEDIUM 25 | Small,3,SMALL 26 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellListInHMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "itemList": [ 6 | { 7 | "id": 1, 8 | "num": 10 9 | }, 10 | { 11 | "id": 2, 12 | "num": 20 13 | } 14 | ] 15 | }, 16 | "2": { 17 | "id": 2, 18 | "itemList": [ 19 | { 20 | "id": 3, 21 | "num": 30 22 | } 23 | ] 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalListInHMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "itemList": [ 6 | { 7 | "id": 1, 8 | "num": 10 9 | }, 10 | { 11 | "id": 2, 12 | "num": 20 13 | } 14 | ] 15 | }, 16 | "2": { 17 | "id": 2, 18 | "itemList": [ 19 | { 20 | "id": 3, 21 | "num": 30 22 | } 23 | ] 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | *.DS_Store 17 | ~$* 18 | .idea/ 19 | _* 20 | cmd/tableauc/tableauc 21 | cmd/tableauc/*.json 22 | cmd/tableauc/*.proto 23 | *.xlsx 24 | *.pb.go 25 | test/dev/testpb/ 26 | test/parallel/proto/ 27 | test/parallel/protoconf/ 28 | .vscode/ 29 | *.prof 30 | test/functest/testdata/xml/*/*.csv 31 | coverage.txt 32 | covdatafiles -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalMapInHMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "itemMap": { 6 | "1": { 7 | "id": 1, 8 | "num": 10 9 | }, 10 | "2": { 11 | "id": 2, 12 | "num": 20 13 | } 14 | } 15 | }, 16 | "2": { 17 | "id": 2, 18 | "itemMap": { 19 | "3": { 20 | "id": 3, 21 | "num": 30 22 | } 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /test/functest/conf/default/FieldPropOptional.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "prop": { 6 | "id": 10, 7 | "flavor": "sour", 8 | "duration": "86400s", 9 | "value": 99 10 | } 11 | }, 12 | "2": { 13 | "id": 2, 14 | "prop": { 15 | "id": 20, 16 | "flavor": "", 17 | "duration": null, 18 | "value": 0 19 | } 20 | }, 21 | "3": { 22 | "id": 3, 23 | "prop": null 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/fieldprop/FieldProp#FieldProp.csv: -------------------------------------------------------------------------------- 1 | ID,Prop1ID,Prop1Flavor,Prop2ID,Prop2Flavor,AppearanceColor,AppearanceShape,BuffID1,AwardID,OptionalBonusID,IncellStruct 2 | "map|{refer:""ItemConf.ID"" range: ""1,100"" sequence: 1 unique:true}","[Prop]int32|{range:""1,10"" fixed:true}",string,int32,string,{Appearance}string,string,"int32|{json_name:""buff_id_1""}","[]uint32|{refer:""ItemConf.ID""}","uint32|{refer:""ItemConf.ID""}",{.Item} 3 | Item ID,Prop 1 ID,Prop 1 flavor,Prop 2 ID,Prop 2 flavor,Appearance color,Appearance shape,Buff ID 1,Award ID list,Optional bonus ID,Incell struct 4 | 1,1,sour,2,sweet,red,round,100,"1,2,3",,"10,1" 5 | -------------------------------------------------------------------------------- /test/functest/conf/default/HPredefStructListInHListFF.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "itemList": [ 5 | { 6 | "id": 1, 7 | "num": 10 8 | }, 9 | { 10 | "id": 2, 11 | "num": 20 12 | } 13 | ], 14 | "name": "Lotto" 15 | }, 16 | { 17 | "itemList": [ 18 | { 19 | "id": 10, 20 | "num": 100 21 | } 22 | ], 23 | "name": "Super Lotto" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalListInHorizontaListFF.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "itemList": [ 5 | { 6 | "id": 1, 7 | "num": 10 8 | }, 9 | { 10 | "id": 2, 11 | "num": 20 12 | } 13 | ], 14 | "name": "Lotto" 15 | }, 16 | { 17 | "itemList": [ 18 | { 19 | "id": 10, 20 | "num": 100 21 | } 22 | ], 23 | "name": "Super Lotto" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/xml/metasheet/Merger.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/functest/conf/default/HPredefStructMapInHListFF.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "itemMap": { 5 | "1": { 6 | "id": 1, 7 | "num": 10 8 | }, 9 | "2": { 10 | "id": 2, 11 | "num": 20 12 | } 13 | }, 14 | "name": "Lotto" 15 | }, 16 | { 17 | "itemMap": { 18 | "10": { 19 | "id": 10, 20 | "num": 100 21 | } 22 | }, 23 | "name": "Super Lotto" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /test/functest/proto/default/yaml__misc__acronym.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"yaml/misc/Acronym.yaml" sep:"," subsep:":"}; 12 | 13 | message YamlAcronymConf { 14 | option (tableau.worksheet) = {name:"YamlAcronymConf"}; 15 | 16 | book in_k8s = 1 [(tableau.field) = {name:"InK8s"}]; 17 | message book { 18 | } 19 | string apiv3_spec = 2 [(tableau.field) = {name:"APIV3Spec"}]; 20 | } 21 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/list/List#EmptyElemList.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,RewardItem1ID,RewardItem1Num,RewardItem2ID,RewardItem2Num,RewardItem3ID,RewardItem3Num,Section1ID,Section2ID,Section3ID,Value1,Value2,Value3,Bonus1ID,Bonus1Num,Bonus2ID,Bonus2Num 2 | "map|{unique:true sequence:1}",string,"map",int32,int32,int32,int32,int32,[Section]uint32,uint32,uint32,[]uint32,uint32,uint32,[.Item]int32,int32,int32,int32 3 | 奖励ID,描述,奖励1ID,奖励1Num,奖励2ID,奖励2Num,奖励2ID,奖励2Num,节ID,,,buff值,,,奖励1ID,奖励1Num,奖励2ID,奖励2Num 4 | 1,奖励1,1001,1,1002,2,1003,3,1,2,3,1,2,3,1001,1,1002,2 5 | 2,奖励2,2001,1,2002,2,,,0,2,,0,2,,,,, 6 | 3,奖励3,3001,1,,,,,1,,,1,,,,,, 7 | 4,奖励4,4001,1,,,,,,,,,,,,,, 8 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/list/VerticalList#VerticalIncellUnionList.csv: -------------------------------------------------------------------------------- 1 | Target 2 | []{union.Target}|{form:FORM_TEXT} 3 | Target info 4 | type:TYPE_PVP pvp:{type:1 damage:10 types:FRUIT_TYPE_APPLE types:FRUIT_TYPE_ORANGE types:FRUIT_TYPE_BANANA} 5 | type:TYPE_PVE pve:{mission:{id:1 level:100 damage:999} heros:1 heros:2 heros:3 dungeons:{key:1 value:10} dungeons:{key:2 value:20} dungeons:{key:3 value:30}} 6 | type:TYPE_STORY story:{cost:{id:1001 num:10} fruits:{key:1 value:FRUIT_TYPE_APPLE} fruits:{key:2 value:FRUIT_TYPE_ORANGE} flavors:{key:1 value:{key:FRUIT_FLAVOR_FRAGRANT value:1}} flavors:{key:2 value:{key:FRUIT_FLAVOR_SOUR value:2}}} 7 | type:TYPE_SKILL skill:{id:1 damage:2} 8 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalMapInHorizontalListFF.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardList": [ 3 | { 4 | "itemMap": { 5 | "1": { 6 | "id": 1, 7 | "num": 10 8 | }, 9 | "2": { 10 | "id": 2, 11 | "num": 20 12 | } 13 | }, 14 | "name": "Lotto" 15 | }, 16 | { 17 | "itemMap": { 18 | "10": { 19 | "id": 10, 20 | "num": 100 21 | } 22 | }, 23 | "name": "Super Lotto" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | push: 5 | branches: [master, main] 6 | pull_request: 7 | branches: [master, main] 8 | 9 | jobs: 10 | golangci: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout Code 14 | uses: actions/checkout@v5 15 | 16 | - name: Install Go 17 | uses: actions/setup-go@v6 18 | with: 19 | go-version-file: go.mod 20 | cache-dependency-path: go.sum 21 | 22 | - name: Lint 23 | uses: golangci/golangci-lint-action@v8.0.0 24 | with: 25 | github-token: ${{ secrets.GITHUB_TOKEN }} 26 | version: v2.2.1 27 | -------------------------------------------------------------------------------- /test/functest/conf/default/IncellEnumMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "fruitMap": { 3 | "1": { 4 | "key": "FRUIT_TYPE_APPLE", 5 | "value": "1" 6 | }, 7 | "3": { 8 | "key": "FRUIT_TYPE_ORANGE", 9 | "value": "2" 10 | } 11 | }, 12 | "flavorMap": { 13 | "1": "FRUIT_FLAVOR_FRAGRANT", 14 | "2": "FRUIT_FLAVOR_SWEET" 15 | }, 16 | "itemMap": { 17 | "1": { 18 | "key": "FRUIT_TYPE_APPLE", 19 | "value": "FRUIT_FLAVOR_FRAGRANT" 20 | }, 21 | "3": { 22 | "key": "FRUIT_TYPE_ORANGE", 23 | "value": "FRUIT_FLAVOR_SOUR" 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalStructKeyedList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "propMap": { 6 | "1": { 7 | "propId": 1, 8 | "propName": "sweet" 9 | } 10 | } 11 | }, 12 | { 13 | "id": 2, 14 | "propMap": { 15 | "1": { 16 | "propId": 1, 17 | "propName": "sweet" 18 | }, 19 | "2": { 20 | "propId": 2, 21 | "propName": "delicious" 22 | } 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /test/functest/conf/default/InCellStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "prop": { 6 | "id": 1, 7 | "name": "Apple", 8 | "desc": "A kind of delicious fruit." 9 | } 10 | }, 11 | "2": { 12 | "id": 2, 13 | "prop": { 14 | "id": 2, 15 | "name": "Orange", 16 | "desc": "" 17 | } 18 | }, 19 | "3": { 20 | "id": 3, 21 | "prop": { 22 | "id": 3, 23 | "name": "", 24 | "desc": "" 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /test/functest/proto/default/yaml__enum.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "common/common.proto"; 9 | import "tableau/protobuf/tableau.proto"; 10 | 11 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 12 | option (tableau.workbook) = {name:"yaml/Enum.yaml" sep:"," subsep:":"}; 13 | 14 | message YamlEnumConf { 15 | option (tableau.worksheet) = {name:"YamlEnumConf"}; 16 | 17 | uint32 id = 1 [(tableau.field) = {name:"ID"}]; 18 | protoconf.FruitType type = 2 [(tableau.field) = {name:"Type"}]; 19 | string desc = 3 [(tableau.field) = {name:"Desc"}]; 20 | } 21 | -------------------------------------------------------------------------------- /test/functest/conf/default/PredefinedInCellStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "prop": { 6 | "id": 1, 7 | "name": "Apple", 8 | "desc": "A kind of delicious fruit." 9 | } 10 | }, 11 | "2": { 12 | "id": 2, 13 | "prop": { 14 | "id": 2, 15 | "name": "Orange", 16 | "desc": "" 17 | } 18 | }, 19 | "3": { 20 | "id": 3, 21 | "prop": { 22 | "id": 3, 23 | "name": "", 24 | "desc": "" 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /test/functest/proto/default/yaml__misc__special_value.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"yaml/misc/SpecialValue.yaml" sep:"," subsep:":"}; 12 | 13 | message YamlSpecialValueConf { 14 | option (tableau.worksheet) = {name:"YamlSpecialValueConf"}; 15 | 16 | string name_with_space = 1 [(tableau.field) = {name:"NameWithSpace"}]; 17 | int32 integer_with_fractional_part = 2 [(tableau.field) = {name:"IntegerWithFractionalPart"}]; 18 | } 19 | -------------------------------------------------------------------------------- /test/functest/conf/default/PredefinedCrossCellStruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "prop": { 6 | "id": 1, 7 | "name": "Apple", 8 | "desc": "A kind of delicious fruit." 9 | } 10 | }, 11 | "2": { 12 | "id": 2, 13 | "prop": { 14 | "id": 2, 15 | "name": "Orange", 16 | "desc": "" 17 | } 18 | }, 19 | "3": { 20 | "id": 3, 21 | "prop": { 22 | "id": 3, 23 | "name": "", 24 | "desc": "" 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /testdata/unittest/patchresult/ModeOnlyPatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "name3": "", 4 | "time": { 5 | "expiry": "7200s" 6 | }, 7 | "priceList": [ 8 | 20, 9 | 200 10 | ], 11 | "replacePriceList": [ 12 | 20, 13 | 200 14 | ], 15 | "itemMap": { 16 | "1": { 17 | "id": 1, 18 | "num": 99 19 | }, 20 | "999": { 21 | "id": 999, 22 | "num": 99900 23 | } 24 | }, 25 | "replaceItemMap": { 26 | "1": { 27 | "id": 1, 28 | "num": 99 29 | }, 30 | "999": { 31 | "id": 999, 32 | "num": 99900 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalKListInVerticalKList.json: -------------------------------------------------------------------------------- 1 | { 2 | "keyedItemList": [ 3 | { 4 | "id": 1, 5 | "desc": "Apple", 6 | "propList": [ 7 | { 8 | "propId": 10, 9 | "propNum": 100 10 | }, 11 | { 12 | "propId": 11, 13 | "propNum": 110 14 | } 15 | ] 16 | }, 17 | { 18 | "id": 2, 19 | "desc": "Orange", 20 | "propList": [ 21 | { 22 | "propId": 20, 23 | "propNum": 200 24 | } 25 | ] 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalListInVerticalKeyedList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "propList": [ 7 | { 8 | "propId": 1, 9 | "propValue": "10" 10 | } 11 | ] 12 | }, 13 | { 14 | "id": 2, 15 | "name": "Orange", 16 | "propList": [ 17 | { 18 | "propId": 1, 19 | "propValue": "20" 20 | }, 21 | { 22 | "propId": 2, 23 | "propValue": "30" 24 | } 25 | ] 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalListInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple", 6 | "propList": [ 7 | { 8 | "propId": 1, 9 | "propValue": "10" 10 | } 11 | ] 12 | }, 13 | "2": { 14 | "id": 2, 15 | "name": "Orange", 16 | "propList": [ 17 | { 18 | "propId": 1, 19 | "propValue": "20" 20 | }, 21 | { 22 | "propId": 2, 23 | "propValue": "30" 24 | } 25 | ] 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalMapInVerticalKeyedList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "propMap": { 7 | "1": { 8 | "propId": 1, 9 | "propValue": "10" 10 | } 11 | } 12 | }, 13 | { 14 | "id": 2, 15 | "name": "Orange", 16 | "propMap": { 17 | "1": { 18 | "propId": 1, 19 | "propValue": "20" 20 | }, 21 | "2": { 22 | "propId": 2, 23 | "propValue": "30" 24 | } 25 | } 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalMapInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple", 6 | "propMap": { 7 | "1": { 8 | "propId": 1, 9 | "propValue": "10" 10 | } 11 | } 12 | }, 13 | "2": { 14 | "id": 2, 15 | "name": "Orange", 16 | "propMap": { 17 | "1": { 18 | "propId": 1, 19 | "propValue": "20" 20 | }, 21 | "2": { 22 | "propId": 2, 23 | "propValue": "30" 24 | } 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /test/functest/proto/default/excel__scalar__scalar.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"excel/scalar/Scalar#*.csv" namerow:1 typerow:2 noterow:3 datarow:4 sep:"," subsep:":"}; 12 | 13 | message Scalar { 14 | option (tableau.worksheet) = {name:"Scalar"}; 15 | 16 | uint32 id = 1 [(tableau.field) = {name:"ID"}]; // Item's ID 17 | string name = 2 [(tableau.field) = {name:"Name"}]; // Item's Name 18 | string desc = 3 [(tableau.field) = {name:"Desc"}]; // Item's Description 19 | } 20 | -------------------------------------------------------------------------------- /test/functest/proto/custom/excel__header__header.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"excel/header/Header#*.csv" namerow:1 typerow:1 noterow:1 datarow:2 nameline:2 typeline:3 noteline:1 sep:"," subsep:":"}; 12 | 13 | message TableHeader { 14 | option (tableau.worksheet) = {name:"TableHeader"}; 15 | 16 | int32 id = 1 [(tableau.field) = {name:"ID"}]; // IDNote 17 | repeated int32 prop_list = 2 [(tableau.field) = {name:"Prop" layout:LAYOUT_INCELL prop:{sep:";"}}]; // PropNote 18 | } 19 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/dev/Test#Reward.csv: -------------------------------------------------------------------------------- 1 | ID,Desc,RewardItem1ID,RewardItem1Num,RewardItem2ID,RewardItem2Num,ExchangeID,InputItem1ID,InputItem1Num,InputItem2ID,InputItem2Num,InputItem3ID,InputItem3Num,OutputItem1ID,OutputItem1Num,OutputItem2ID,OutputItem2Num 2 | "map|{unique:true sequence:1}",string,"map",int32,int32,int32,[Exchange]uint32,[ExchangeItem]int32,int32,int32,int32,int32,int32,[ExchangeItem]int32,int32,int32,int32 3 | 奖励ID,描述,奖励1ID,奖励1Num,奖励2ID,奖励2Num,兑换ID,道具1ID,道具1Num,道具2ID,道具2Num,道具3ID,道具3Num,奖励1ID,奖励1Num,奖励2ID,奖励2Num 4 | 1,奖励1,1,2002,2,2002,1,2002,3,2002,2,2002,3,2002,3,, 5 | 2,奖励2,2,2002,1,2002,2,2002,3,2002,2,2002,3,2002,3,, 6 | 3,奖励3,3,2002,,,2,2002,3,2002,2,2002,3,2002,3,, 7 | 4,奖励4,1,2001,,,1,2007,10,2001,1,,,2007,10,, 8 | -------------------------------------------------------------------------------- /test/functest/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # set -eux 3 | set -e 4 | set -o pipefail 5 | 6 | cd "$(git rev-parse --show-toplevel)" 7 | cd test/functest 8 | 9 | rm -rf covdatafiles 10 | mkdir covdatafiles 11 | 12 | # Build mdtool binary for testing purposes. 13 | rm -f functest.exe 14 | go build -cover -o functest.exe . 15 | 16 | # Pass in "-cover" to the script to build for coverage, then 17 | # run with GOCOVERDIR set. 18 | GOCOVERDIR=covdatafiles ./functest.exe 19 | 20 | # Post-process the resulting profiles. 21 | # go tool covdata percent -i=covdatafiles 22 | 23 | # Converting profiles to ‘-coverprofile’ text format 24 | go tool covdata textfmt -i=covdatafiles -o=/tmp/coverage.txt 25 | # remove generated file coverage 26 | grep -v '.pb.go' /tmp/coverage.txt > coverage.txt 27 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/union/Union#FieldCapUnion.csv: -------------------------------------------------------------------------------- 1 | ID,TargetType,TargetField1,TargetField2,TargetField3,TargetField4,TargetField5,TargetField6 2 | "map",{.FieldCapTarget}enum<.FieldCapTarget.Type>,union,union,union,union,union,union 3 | ID,Target type,Target field1,Target field2,Target field3,Target field4,Target field5,Target field6 4 | 1,Exchange,9001,"1001,10","1002,20",,"1003,30","1004,40" 5 | 2,Exchange,9002,"1001,100",,,"1003,300", 6 | 3,Vote,1,2,3,4,5,6 7 | 4,Vote,1,,3,4,,6 8 | 5,Fruit,FRUIT_TYPE_APPLE,FRUIT_TYPE_ORANGE,FRUIT_TYPE_APPLE,FRUIT_TYPE_ORANGE,FRUIT_FLAVOR_FRAGRANT,FRUIT_FLAVOR_SOUR 9 | 6,Fruit,FRUIT_TYPE_APPLE,FRUIT_TYPE_ORANGE,,"FRUIT_TYPE_APPLE,FRUIT_TYPE_ORANGE",FRUIT_FLAVOR_SWEET, 10 | 7,Key,1,2,3,4,5,6 11 | 8,Key,1,,,2,2,2 12 | -------------------------------------------------------------------------------- /internal/strcase/doc.go: -------------------------------------------------------------------------------- 1 | // Package strcase converts strings to various cases. See the conversion table below: 2 | // 3 | // | Function | Result | 4 | // |---------------------------------|--------------------| 5 | // | ToSnake(s) | any_kind_of_string | 6 | // | ToScreamingSnake(s) | ANY_KIND_OF_STRING | 7 | // | ToKebab(s) | any-kind-of-string | 8 | // | ToScreamingKebab(s) | ANY-KIND-OF-STRING | 9 | // | ToDelimited(s, '.') | any.kind.of.string | 10 | // | ToScreamingDelimited(s, '.') | ANY.KIND.OF.STRING | 11 | // | ToCamel(s) | AnyKindOfString | 12 | // | ToLowerCamel(s) | anyKindOfString | 13 | package strcase 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. This produces predictable results in different environments. 3 | # 4 | # Windows users contributing to this repo will need to use a modern version 5 | # of git and editors capable of LF line endings. 6 | # 7 | # Windows .bat files are known to have multiple bugs when run with LF 8 | # endings, and so they are checked in with CRLF endings, with a test 9 | # to catch problems. (See https://github.com/golang/go/issues/37791.) 10 | # 11 | # We'll prevent accidental CRLF line endings from entering the repo 12 | # via MR/PR checks and tests. 13 | # 14 | # See https://github.com/golang/go/issues/9281. 15 | # See https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line. 16 | * -text 17 | -------------------------------------------------------------------------------- /test/functest/proto/default/yaml__metasheet__yaml_scatter.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"yaml/metasheet/YamlScatter.yaml" sep:"," subsep:":"}; 12 | 13 | message YamlScatterConf { 14 | option (tableau.worksheet) = {name:"YamlScatterConf" scatter:"YamlScatter*.yaml"}; 15 | 16 | Fruit strict_struct = 1 [(tableau.field) = {name:"StrictStruct"}]; 17 | message Fruit { 18 | uint32 id = 1 [(tableau.field) = {name:"ID"}]; 19 | string name = 2 [(tableau.field) = {name:"Name"}]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/functest/conf/default/FieldPropOrder.json: -------------------------------------------------------------------------------- 1 | { 2 | "playerMap": { 3 | "1": { 4 | "id": 1, 5 | "score": 100, 6 | "time": "2020-01-01T10:25:00+08:00", 7 | "duration": "241s" 8 | }, 9 | "2": { 10 | "id": 2, 11 | "score": 90, 12 | "time": "2021-01-01T10:25:00+08:00", 13 | "duration": "181s" 14 | }, 15 | "3": { 16 | "id": 3, 17 | "score": 90, 18 | "time": "2022-01-01T10:25:00+08:00", 19 | "duration": "121s" 20 | }, 21 | "4": { 22 | "id": 4, 23 | "score": 80, 24 | "time": "2023-01-01T10:25:00+08:00", 25 | "duration": "61s" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalWrappedUnionList.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskList": [ 3 | { 4 | "target": { 5 | "type": "TYPE_PLAYER", 6 | "player": { 7 | "id": 1, 8 | "name": "Mike" 9 | } 10 | } 11 | }, 12 | { 13 | "target": { 14 | "type": "TYPE_PAWN", 15 | "pawn": { 16 | "count": 10 17 | } 18 | } 19 | }, 20 | { 21 | "target": { 22 | "type": "TYPE_BOSS", 23 | "boss": { 24 | "health": 200, 25 | "attack": 100 26 | } 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /test/functest/proto/default/csv__bom__utf_8_bom.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"csv/BOM/UTF8BOM#*.csv" namerow:1 typerow:2 noterow:3 datarow:4 sep:"," subsep:":"}; 12 | 13 | message UTF8BOM { 14 | option (tableau.worksheet) = {name:"UTF8BOM"}; 15 | 16 | map item_map = 1 [(tableau.field) = {key:"ID" layout:LAYOUT_VERTICAL}]; 17 | message Item { 18 | int64 id = 1 [(tableau.field) = {name:"ID"}]; // 道具ID 19 | string name = 2 [(tableau.field) = {name:"Name"}]; // 道具名 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/functest/testdata/default/xml/metasheet/Metasheet.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 100 23 | 24 | 25 | 26 | {% if proc.name == 'gamesvr' %} 27 | 28 | {% endif %} 29 | 30 | -------------------------------------------------------------------------------- /test/functest/conf/default/ExchangeInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewardMap": { 3 | "1": { 4 | "id": 1, 5 | "desc": "award1", 6 | "beginTime": "2020-01-01T05:00:00+08:00", 7 | "date": "2020-01-01T00:00:00+08:00", 8 | "time": "18000s" 9 | }, 10 | "2": { 11 | "id": 2, 12 | "desc": "award2", 13 | "beginTime": "2020-01-01T05:00:00+08:00", 14 | "date": "2020-01-01T00:00:00+08:00", 15 | "time": "18000s" 16 | }, 17 | "3": { 18 | "id": 3, 19 | "desc": "award3", 20 | "beginTime": "2020-01-01T05:00:00+08:00", 21 | "date": "2020-01-01T00:00:00+08:00", 22 | "time": "18000s" 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /test/functest/conf/default/FieldPropForm.json: -------------------------------------------------------------------------------- 1 | { 2 | "transform1": { 3 | "position": { 4 | "x": 1, 5 | "y": 2, 6 | "z": 3 7 | }, 8 | "rotation": { 9 | "x": 4, 10 | "y": 5, 11 | "z": 6 12 | }, 13 | "scale": { 14 | "x": 7, 15 | "y": 8, 16 | "z": 9 17 | } 18 | }, 19 | "transform2": { 20 | "position": { 21 | "x": 1, 22 | "y": 2, 23 | "z": 3 24 | }, 25 | "rotation": { 26 | "x": 4, 27 | "y": 5, 28 | "z": 6 29 | }, 30 | "scale": { 31 | "x": 7, 32 | "y": 8, 33 | "z": 9 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalWrappedUnionList.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskList": [ 3 | { 4 | "target": { 5 | "type": "TYPE_PLAYER", 6 | "player": { 7 | "id": 1, 8 | "name": "Mike" 9 | } 10 | } 11 | }, 12 | { 13 | "target": { 14 | "type": "TYPE_PAWN", 15 | "pawn": { 16 | "count": 10 17 | } 18 | } 19 | }, 20 | { 21 | "target": { 22 | "type": "TYPE_BOSS", 23 | "boss": { 24 | "health": 200, 25 | "attack": 100 26 | } 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /test/functest/conf/default/YamlStructConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "strictStruct": { 3 | "id": 1, 4 | "name": "apple" 5 | }, 6 | "struct": { 7 | "id": 1, 8 | "startTime": "2024-10-01T10:10:10+08:00", 9 | "expire": "3600s" 10 | }, 11 | "reusePredefinedStruct": { 12 | "id": 2, 13 | "startTime": "2026-10-01T10:10:10+08:00", 14 | "expire": "7200s" 15 | }, 16 | "predefinedStruct": { 17 | "id": 1, 18 | "num": 10 19 | }, 20 | "incellStruct": { 21 | "id": 2, 22 | "num": 20 23 | }, 24 | "incellStruct2": { 25 | "id": 3, 26 | "num": 30 27 | }, 28 | "predefinedIncellStruct": { 29 | "id": 4, 30 | "num": 40 31 | }, 32 | "emptyStruct": null 33 | } -------------------------------------------------------------------------------- /test/functest/proto/default/VerticalWrappedUnionList.json: -------------------------------------------------------------------------------- 1 | { 2 | "targetList": [ 3 | { 4 | "target": { 5 | "type": "TYPE_PLAYER", 6 | "player": { 7 | "id": 1, 8 | "name": "Mike" 9 | } 10 | } 11 | }, 12 | { 13 | "target": { 14 | "type": "TYPE_PAWN", 15 | "pawn": { 16 | "count": 10 17 | } 18 | } 19 | }, 20 | { 21 | "target": { 22 | "type": "TYPE_BOSS", 23 | "boss": { 24 | "health": 200, 25 | "attack": 100 26 | } 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#UnionTaskTarget.csv: -------------------------------------------------------------------------------- 1 | Name,Alias,Field1,Field2,Field3 2 | PVP,AliasPVP,"ID 3 | uint32 4 | Note","Damage 5 | int64 6 | Note","Type 7 | []enum<.FruitType> 8 | Note" 9 | PVE,AliasPVE,"Mission 10 | {uint32 ID, enum<.ItemType> Type}Mission 11 | Note","Hero 12 | []uint32 13 | Note","Dungeon 14 | map 15 | Note" 16 | Story,AliasStory,"Cost 17 | {.Item} 18 | Note","Fruit 19 | map> 20 | Note","Flavor 21 | map, enum<.FruitType>> 22 | Note" 23 | Hobby,AliasHobby,"Flavor 24 | map, enum<.FruitType>> 25 | Note","StartTime 26 | datetime 27 | Note","Duration 28 | duration 29 | Note" 30 | Skill,AliasSkill,"ID 31 | uint32 32 | Note","Damage 33 | int64 34 | Note", 35 | Empty,AliasEmpty,,, 36 | -------------------------------------------------------------------------------- /testdata/unittest/patchresult/ModeOnlyMain.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apple", 3 | "name2": "apple2", 4 | "name3": "apple3", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "3600s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100 12 | ], 13 | "replacePriceList": [ 14 | 10, 15 | 100 16 | ], 17 | "itemMap": { 18 | "1": { 19 | "id": 1, 20 | "num": 10 21 | }, 22 | "2": { 23 | "id": 2, 24 | "num": 20 25 | } 26 | }, 27 | "replaceItemMap": { 28 | "1": { 29 | "id": 1, 30 | "num": 10 31 | }, 32 | "2": { 33 | "id": 2, 34 | "num": 20 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchDirs-merge-not-existed.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apple", 3 | "name2": "apple2", 4 | "name3": "apple3", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "3600s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100 12 | ], 13 | "replacePriceList": [ 14 | 10, 15 | 100 16 | ], 17 | "itemMap": { 18 | "1": { 19 | "id": 1, 20 | "num": 10 21 | }, 22 | "2": { 23 | "id": 2, 24 | "num": 20 25 | } 26 | }, 27 | "replaceItemMap": { 28 | "1": { 29 | "id": 1, 30 | "num": 10 31 | }, 32 | "2": { 33 | "id": 2, 34 | "num": 20 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /test/functest/testdata/default/xml/metasheet/Merger1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /testdata/unittest/conf/PatchMergeConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apple", 3 | "name2": "apple2", 4 | "name3": "apple3", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "3600s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100 12 | ], 13 | "replacePriceList": [ 14 | 10, 15 | 100 16 | ], 17 | "itemMap": { 18 | "1": { 19 | "id": 1, 20 | "num": 10 21 | }, 22 | "2": { 23 | "id": 2, 24 | "num": 20 25 | } 26 | }, 27 | "replaceItemMap": { 28 | "1": { 29 | "id": 1, 30 | "num": 10 31 | }, 32 | "2": { 33 | "id": 2, 34 | "num": 20 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /test/functest/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/tableauio/tableau/xerrors" 7 | ) 8 | 9 | func main() { 10 | CompareGeneratedProto() 11 | CompareGeneratedJSON() 12 | } 13 | 14 | func CompareGeneratedProto() { 15 | err := genProto("DEBUG", "FULL") 16 | if err != nil { 17 | log.Fatalf("%+v", err) 18 | log.Fatalf("%s", xerrors.NewDesc(err)) 19 | } 20 | err = EqualTextFile(".proto", "proto", "_proto", 2) 21 | if err != nil { 22 | log.Fatal(err) 23 | } 24 | } 25 | 26 | func CompareGeneratedJSON() { 27 | err := genConf("DEBUG", "FULL") 28 | if err != nil { 29 | log.Fatalf("%+v", err) 30 | log.Fatalf("%s", xerrors.NewDesc(err)) 31 | } 32 | err = EqualTextFile(".json", "conf", "_conf", 1) 33 | if err != nil { 34 | log.Fatal(err) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/functest/proto/default/xml__union.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "common/union.proto"; 9 | import "tableau/protobuf/tableau.proto"; 10 | 11 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 12 | option (tableau.workbook) = {name:"xml/Union.xml" sep:"," subsep:":"}; 13 | 14 | message XMLUnionConf { 15 | option (tableau.worksheet) = {name:"XMLUnionConf"}; 16 | 17 | union.Target predefined_union = 1 [(tableau.field) = {name:"PredefinedUnion"}]; 18 | union.Target predefined_incell_union = 2 [(tableau.field) = {name:"PredefinedIncellUnion" span:SPAN_INNER_CELL prop:{form:FORM_TEXT}}]; 19 | repeated union.Target union_list = 3 [(tableau.field) = {name:"Union"}]; 20 | } 21 | -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchDirs-merge-none-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "name2": "apple2", 4 | "name3": "", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "7200s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100, 12 | 20, 13 | 200 14 | ], 15 | "replacePriceList": [ 16 | 20, 17 | 200 18 | ], 19 | "itemMap": { 20 | "1": { 21 | "id": 1, 22 | "num": 10 23 | }, 24 | "2": { 25 | "id": 2, 26 | "num": 20 27 | } 28 | }, 29 | "replaceItemMap": { 30 | "1": { 31 | "id": 1, 32 | "num": 10 33 | }, 34 | "2": { 35 | "id": 2, 36 | "num": 20 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /log/logger_test.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/tableauio/tableau/log/core" 7 | "github.com/tableauio/tableau/log/driver/defaultdriver" 8 | ) 9 | 10 | func TestDefaultLogger_Debugf(t *testing.T) { 11 | type args struct { 12 | format string 13 | args []any 14 | } 15 | tests := []struct { 16 | name string 17 | l *Logger 18 | args args 19 | }{ 20 | // TODO: Add test cases. 21 | { 22 | name: "test", 23 | l: &Logger{ 24 | level: core.DebugLevel, 25 | driver: &defaultdriver.DefaultDriver{}, 26 | }, 27 | args: args{ 28 | format: "format: %s, %d", 29 | args: []any{"haha", 3}, 30 | }, 31 | }, 32 | } 33 | for _, tt := range tests { 34 | t.Run(tt.name, func(t *testing.T) { 35 | tt.l.Debugf(tt.args.format, tt.args.args...) 36 | }) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalListInVerticalList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "propList": [ 7 | { 8 | "id": 1, 9 | "value": "10" 10 | }, 11 | { 12 | "id": 2, 13 | "value": "20" 14 | } 15 | ] 16 | }, 17 | { 18 | "id": 2, 19 | "name": "Orange", 20 | "propList": [ 21 | { 22 | "id": 3, 23 | "value": "30" 24 | } 25 | ] 26 | }, 27 | { 28 | "id": 3, 29 | "name": "Banana", 30 | "propList": [] 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /test/functest/proto/default/yaml__metasheet__merger.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"yaml/metasheet/Merger.yaml" sep:"," subsep:":"}; 12 | 13 | message YamlMergerConf { 14 | option (tableau.worksheet) = {name:"YamlMergerConf" merger:"Merger*.yaml"}; 15 | 16 | map struct_map = 1 [(tableau.field) = {name:"StructMap" key:"@key"}]; 17 | message Item { 18 | uint32 key = 1 [(tableau.field) = {name:"@key"}]; 19 | string name = 2 [(tableau.field) = {name:"Name"}]; 20 | int32 num = 3 [(tableau.field) = {name:"Num"}]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchPaths-merge-none-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "name2": "apple2", 4 | "name3": "", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "7200s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100, 12 | 20, 13 | 200 14 | ], 15 | "replacePriceList": [ 16 | 20, 17 | 200 18 | ], 19 | "itemMap": { 20 | "1": { 21 | "id": 1, 22 | "num": 10 23 | }, 24 | "2": { 25 | "id": 2, 26 | "num": 20 27 | } 28 | }, 29 | "replaceItemMap": { 30 | "1": { 31 | "id": 1, 32 | "num": 10 33 | }, 34 | "2": { 35 | "id": 2, 36 | "num": 20 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /docs/tutorial.md: -------------------------------------------------------------------------------- 1 | # Tutorial 2 | 3 | ## A Simple Example 4 | 5 | Workbook: "club.xlsx", Worksheet: "member" 6 | 7 | | ID | Name | Age | Description | 8 | | --- | ----- | --- | ---------------------------------- | 9 | | 1 | Bob | 24 | A high school student. | 10 | | 2 | Lily | 19 | A famous female model. | 11 | | 3 | Blues | 35 | A famous action star in the world. | 12 | 13 | ```proto3 14 | option (workbook) = "club.xlsx" 15 | message MemberConf { 16 | option (worksheet) = "member"; 17 | map member_map = 1 [ (key) = "ID" ]; 18 | 19 | message Member { 20 | int32 id = 1 [ (caption) = "ID" ]; 21 | string name = 2 [ (caption) = "Name" ]; 22 | int32 age = 3 [ (caption) = "Age" ]; 23 | string desc = 5 [ (caption) = "Description" ]; 24 | } 25 | } 26 | ``` -------------------------------------------------------------------------------- /internal/printer/printer_test.go: -------------------------------------------------------------------------------- 1 | package printer_test 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | "github.com/tableauio/tableau/internal/printer" 9 | "github.com/tableauio/tableau/internal/x/xfs" 10 | ) 11 | 12 | func init() { 13 | _ = os.MkdirAll("_out", xfs.DefaultDirPerm) 14 | } 15 | 16 | func TestPrinter(t *testing.T) { 17 | p := printer.New() 18 | p.P("test") 19 | assert.Equal(t, "test\n", p.String()) 20 | assert.Equal(t, []byte("test\n"), p.Bytes()) 21 | err := p.Save("_out/printer.txt") 22 | assert.NoError(t, err) 23 | err = p.SaveWithGoFormat("_out/printer_go.txt") 24 | assert.NoError(t, err) 25 | } 26 | 27 | func TestIndent(t *testing.T) { 28 | str := printer.Indent(1) 29 | assert.Equal(t, " ", str) 30 | str = printer.Indent(2) 31 | assert.Equal(t, " ", str) 32 | } 33 | -------------------------------------------------------------------------------- /test/functest/proto/default/yaml__union.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "common/union.proto"; 9 | import "tableau/protobuf/tableau.proto"; 10 | 11 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 12 | option (tableau.workbook) = {name:"yaml/Union.yaml" sep:"," subsep:":"}; 13 | 14 | message YamlUnionConf { 15 | option (tableau.worksheet) = {name:"YamlUnionConf"}; 16 | 17 | union.Target predefined_union = 1 [(tableau.field) = {name:"PredefinedUnion"}]; 18 | union.Target predefined_incell_union = 2 [(tableau.field) = {name:"PredefinedIncellUnion" span:SPAN_INNER_CELL prop:{form:FORM_TEXT}}]; 19 | repeated union.Target union_list = 3 [(tableau.field) = {name:"UnionList"}]; 20 | } 21 | -------------------------------------------------------------------------------- /test/functest/testdata/default/excel/metasheet/SheetMode#UnionTypeReuseInBook.csv: -------------------------------------------------------------------------------- 1 | ID," Progress",TaskTargetType,TaskTargetField1,TaskTargetField2,TaskTargetField3,HeroTargetType,HeroTargetField1,HeroTargetField2,HeroTargetField3 2 | "map"," int32",{.TaskTarget}enum<.TaskTarget.Type>,union,union,union,{.HeroTarget}enum<.HeroTarget.Type>,union,union,union 3 | ID," Progress",Target type,Target field1,Target field2,Target field3,Hero target type,Hero target field1,Hero target field2, 4 | 1,3,AliasPVP,1,10,"Apple,Orange,Banana",HeroStarUp,1,5, 5 | 2,10,AliasPVE,"1,Equip","1,2,3","1:10,2:20,3:30",HeroLevelUp,"1,2,3",10,TRUE 6 | 3,10,AliasStory,"1001,10","1:Apple,2:Orange","Fragrant:Apple,Sour:Orange",,,, 7 | 4,12,AliasHobby,"Fragrant:Apple,Sour:Orange",2023-06-01 10:00:00,22s,,,, 8 | 5,8,AliasSkill,1,200,,,,, 9 | 6,1,AliasEmpty,,,,,,, 10 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalMapInVerticalList.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemList": [ 3 | { 4 | "id": 1, 5 | "name": "Apple", 6 | "propMap": { 7 | "1": { 8 | "id": 1, 9 | "value": "10" 10 | }, 11 | "2": { 12 | "id": 2, 13 | "value": "20" 14 | } 15 | } 16 | }, 17 | { 18 | "id": 2, 19 | "name": "Orange", 20 | "propMap": { 21 | "3": { 22 | "id": 3, 23 | "value": "30" 24 | } 25 | } 26 | }, 27 | { 28 | "id": 3, 29 | "name": "Banana", 30 | "propMap": {} 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /test/functest/conf/default/FieldProp.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "propList": [ 6 | { 7 | "id": 1, 8 | "flavor": "sour" 9 | }, 10 | { 11 | "id": 2, 12 | "flavor": "sweet" 13 | } 14 | ], 15 | "appearance": { 16 | "color": "red", 17 | "shape": "round" 18 | }, 19 | "buff_id_1": 100, 20 | "awardIdList": [ 21 | 1, 22 | 2, 23 | 3 24 | ], 25 | "optionalBonusId": 0, 26 | "incellStruct": { 27 | "id": 10, 28 | "num": 1 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalListInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple", 6 | "propList": [ 7 | { 8 | "id": 1, 9 | "value": "10" 10 | }, 11 | { 12 | "id": 2, 13 | "value": "20" 14 | } 15 | ] 16 | }, 17 | "2": { 18 | "id": 2, 19 | "name": "Orange", 20 | "propList": [ 21 | { 22 | "id": 3, 23 | "value": "30" 24 | } 25 | ] 26 | }, 27 | "3": { 28 | "id": 3, 29 | "name": "Banana", 30 | "propList": [] 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchPaths-with-PatchDirs-merge-none-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "name2": "apple2", 4 | "name3": "", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "7200s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100, 12 | 20, 13 | 200 14 | ], 15 | "replacePriceList": [ 16 | 20, 17 | 200 18 | ], 19 | "itemMap": { 20 | "1": { 21 | "id": 1, 22 | "num": 10 23 | }, 24 | "2": { 25 | "id": 2, 26 | "num": 20 27 | } 28 | }, 29 | "replaceItemMap": { 30 | "1": { 31 | "id": 1, 32 | "num": 10 33 | }, 34 | "2": { 35 | "id": 2, 36 | "num": 20 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalMapInVerticalMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "itemMap": { 3 | "1": { 4 | "id": 1, 5 | "name": "Apple", 6 | "propMap": { 7 | "1": { 8 | "id": 1, 9 | "value": "10" 10 | }, 11 | "2": { 12 | "id": 2, 13 | "value": "20" 14 | } 15 | } 16 | }, 17 | "2": { 18 | "id": 2, 19 | "name": "Orange", 20 | "propMap": { 21 | "3": { 22 | "id": 3, 23 | "value": "30" 24 | } 25 | } 26 | }, 27 | "3": { 28 | "id": 3, 29 | "name": "Banana", 30 | "propMap": {} 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /test/functest/conf/default/VerticalWrappedUnionMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskMap": { 3 | "1": { 4 | "id": 1, 5 | "target": { 6 | "type": "TYPE_PLAYER", 7 | "player": { 8 | "id": 1, 9 | "name": "Mike" 10 | } 11 | } 12 | }, 13 | "2": { 14 | "id": 2, 15 | "target": { 16 | "type": "TYPE_PAWN", 17 | "pawn": { 18 | "count": 10 19 | } 20 | } 21 | }, 22 | "3": { 23 | "id": 3, 24 | "target": { 25 | "type": "TYPE_BOSS", 26 | "boss": { 27 | "health": 200, 28 | "attack": 100 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /test/functest/proto/default/excel__metasheet__aliased_workbook.proto: -------------------------------------------------------------------------------- 1 | // Code generated by tableau (protogen v0.9.0). DO NOT EDIT. 2 | // clang-format off 3 | 4 | syntax = "proto3"; 5 | 6 | package protoconf; 7 | 8 | import "tableau/protobuf/tableau.proto"; 9 | 10 | option go_package = "github.com/tableauio/tableau/test/functest/protoconf"; 11 | option (tableau.workbook) = {name:"excel/metasheet/BookAlias#*.csv" alias:"AliasedWorkbook" namerow:1 typerow:2 noterow:3 datarow:4 sep:"," subsep:":"}; 12 | 13 | message AliasedSheetScalar { 14 | option (tableau.worksheet) = {name:"Scalar" labels:{key:"app" value:"gamesvr"} labels:{key:"patch" value:"merge"}}; 15 | 16 | uint32 id = 1 [(tableau.field) = {name:"ID"}]; // Item ID 17 | string name = 2 [(tableau.field) = {name:"Name"}]; // Item Name 18 | string desc = 3 [(tableau.field) = {name:"Desc"}]; // Item Description 19 | } 20 | -------------------------------------------------------------------------------- /test/functest/conf/default/HorizontalWrappedUnionMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "taskMap": { 3 | "1": { 4 | "id": 1, 5 | "target": { 6 | "type": "TYPE_PLAYER", 7 | "player": { 8 | "id": 1, 9 | "name": "Mike" 10 | } 11 | } 12 | }, 13 | "2": { 14 | "id": 2, 15 | "target": { 16 | "type": "TYPE_PAWN", 17 | "pawn": { 18 | "count": 10 19 | } 20 | } 21 | }, 22 | "3": { 23 | "id": 3, 24 | "target": { 25 | "type": "TYPE_BOSS", 26 | "boss": { 27 | "health": 200, 28 | "attack": 100 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /cmd/tableauc/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | lang: en 2 | locationName: Asia/Shanghai 3 | log: 4 | level: DEBUG 5 | mode: FULL 6 | filename: ./testdata/_log/log.txt 7 | sink: MULTI 8 | proto: 9 | input: 10 | header: 11 | namerow: 1 12 | typerow: 2 13 | noterow: 3 14 | datarow: 4 15 | formats: ["csv"] 16 | subdirs: 17 | - testdata/csv 18 | output: 19 | subdir: testdata/_proto 20 | filenameWithSubdirPrefix: false 21 | filenameSuffix: _conf 22 | fileOptions: 23 | go_package: github.com/tableauio/tableau/protoconf 24 | conf: 25 | input: 26 | protoPaths: ["testdata/_proto/", "."] 27 | protoFiles: ["testdata/_proto/*.proto"] 28 | output: 29 | subdir: testdata/_conf 30 | formats: ["json"] 31 | # formats: ["json", "txt", "bin"] 32 | pretty: true 33 | emitUnpopulated: true 34 | -------------------------------------------------------------------------------- /internal/importer/book/options.go: -------------------------------------------------------------------------------- 1 | package book 2 | 3 | type TableOptions struct { 4 | BeginRow, EndRow int 5 | BeginCol, EndCol int 6 | } 7 | 8 | // Option is the functional option type. 9 | type TableOption func(*TableOptions) 10 | 11 | // Rows sets the table-occupied row range of the whole sheet: [begin, end). 12 | func Rows(begin, end int) TableOption { 13 | return func(opts *TableOptions) { 14 | opts.BeginRow = begin 15 | opts.EndRow = end 16 | } 17 | } 18 | 19 | // Cols sets the table-occupied column range of the whole sheet: [begin, end). 20 | func Cols(begin, end int) TableOption { 21 | return func(opts *TableOptions) { 22 | opts.BeginCol = begin 23 | opts.EndCol = end 24 | } 25 | } 26 | 27 | func parseTableOptions(setters ...TableOption) *TableOptions { 28 | opts := &TableOptions{} 29 | for _, setter := range setters { 30 | setter(opts) 31 | } 32 | return opts 33 | } 34 | -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchDirs-merge-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apple", 3 | "name2": "apple2", 4 | "name3": "apple3", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "3600s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100 12 | ], 13 | "replacePriceList": [ 14 | 10, 15 | 100 16 | ], 17 | "itemMap": { 18 | "1": { 19 | "id": 1, 20 | "num": 99 21 | }, 22 | "2": { 23 | "id": 2, 24 | "num": 20 25 | }, 26 | "999": { 27 | "id": 999, 28 | "num": 99900 29 | } 30 | }, 31 | "replaceItemMap": { 32 | "1": { 33 | "id": 1, 34 | "num": 99 35 | }, 36 | "999": { 37 | "id": 999, 38 | "num": 99900 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /internal/confgen/stats.go: -------------------------------------------------------------------------------- 1 | package confgen 2 | 3 | import ( 4 | "github.com/emirpasic/gods/lists/arraylist" 5 | "github.com/tableauio/tableau/log" 6 | ) 7 | 8 | type messagerStatsInfo struct { 9 | Name any 10 | Milliseconds int64 11 | } 12 | 13 | func PrintPerfStats(gen *Generator) { 14 | // print performance stats 15 | list := arraylist.New() 16 | gen.PerfStats.Range(func(key, value any) bool { 17 | list.Add(&messagerStatsInfo{ 18 | Name: key, 19 | Milliseconds: value.(int64), 20 | }) 21 | return true 22 | }) 23 | list.Sort(func(a, b any) int { 24 | infoA := a.(*messagerStatsInfo) 25 | infoB := b.(*messagerStatsInfo) 26 | return int(infoB.Milliseconds - infoA.Milliseconds) 27 | }) 28 | list.Each(func(index int, value any) { 29 | info := value.(*messagerStatsInfo) 30 | log.Debugf("timespan|%v: %vs", info.Name, float64(info.Milliseconds)/1000) 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /cmd/tableauc/testdata/config_subdir_rewrites.yaml: -------------------------------------------------------------------------------- 1 | lang: en 2 | locationName: Asia/Shanghai 3 | log: 4 | level: DEBUG 5 | mode: FULL 6 | filename: ./_log/log.txt 7 | sink: MULTI 8 | proto: 9 | input: 10 | header: 11 | namerow: 1 12 | typerow: 2 13 | noterow: 3 14 | datarow: 4 15 | formats: ["csv"] 16 | subdirs: 17 | - testdata/csv 18 | output: 19 | subdir: testdata/_proto 20 | filenameWithSubdirPrefix: false 21 | filenameSuffix: _conf 22 | fileOptions: 23 | go_package: github.com/tableauio/tableau/protoconf 24 | conf: 25 | input: 26 | protoPaths: ["_proto/", "."] 27 | protoFiles: ["_proto/*.proto"] 28 | subdirRewrites: 29 | "testdata/": "" 30 | output: 31 | subdir: _conf 32 | formats: ["json"] 33 | # formats: ["json", "txt", "bin"] 34 | pretty: true 35 | emitUnpopulated: true 36 | -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchPaths-different-format-merge-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apple", 3 | "name2": "apple2", 4 | "name3": "apple3", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "3600s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100 12 | ], 13 | "replacePriceList": [ 14 | 10, 15 | 100 16 | ], 17 | "itemMap": { 18 | "1": { 19 | "id": 1, 20 | "num": 99 21 | }, 22 | "2": { 23 | "id": 2, 24 | "num": 20 25 | }, 26 | "999": { 27 | "id": 999, 28 | "num": 99900 29 | } 30 | }, 31 | "replaceItemMap": { 32 | "1": { 33 | "id": 1, 34 | "num": 99 35 | }, 36 | "999": { 37 | "id": 999, 38 | "num": 99900 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /test/functest/conf/default/YamlFieldPropOptionalConf.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "num": 0, 4 | "type": "FRUIT_TYPE_UNKNOWN", 5 | "optionalStruct": null, 6 | "structMap": { 7 | "1": { 8 | "key": 1, 9 | "name": "apple", 10 | "num": 10 11 | }, 12 | "2": { 13 | "key": 2, 14 | "name": "orange", 15 | "num": 20 16 | }, 17 | "3": { 18 | "key": 3, 19 | "name": "banana", 20 | "num": 0 21 | } 22 | }, 23 | "optionalStructMap": {}, 24 | "structList": [ 25 | { 26 | "name": "apple", 27 | "num": 10 28 | }, 29 | { 30 | "name": "orange", 31 | "num": 20 32 | }, 33 | { 34 | "name": "banana", 35 | "num": 0 36 | } 37 | ], 38 | "optionalStructList": [] 39 | } -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchDirs-merge-multiple-dirs.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "name2": "apple2", 4 | "name3": "", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "7200s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100, 12 | 20, 13 | 200 14 | ], 15 | "replacePriceList": [ 16 | 20, 17 | 200 18 | ], 19 | "itemMap": { 20 | "1": { 21 | "id": 1, 22 | "num": 99 23 | }, 24 | "2": { 25 | "id": 2, 26 | "num": 20 27 | }, 28 | "999": { 29 | "id": 999, 30 | "num": 99900 31 | } 32 | }, 33 | "replaceItemMap": { 34 | "1": { 35 | "id": 1, 36 | "num": 99 37 | }, 38 | "999": { 39 | "id": 999, 40 | "num": 99900 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /testdata/unittest/patchresult/PatchPaths-merge-multiple-paths.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orange", 3 | "name2": "apple2", 4 | "name3": "", 5 | "time": { 6 | "start": "2024-10-01T02:10:10Z", 7 | "expiry": "7200s" 8 | }, 9 | "priceList": [ 10 | 10, 11 | 100, 12 | 20, 13 | 200 14 | ], 15 | "replacePriceList": [ 16 | 20, 17 | 200 18 | ], 19 | "itemMap": { 20 | "1": { 21 | "id": 1, 22 | "num": 99 23 | }, 24 | "2": { 25 | "id": 2, 26 | "num": 20 27 | }, 28 | "999": { 29 | "id": 999, 30 | "num": 99900 31 | } 32 | }, 33 | "replaceItemMap": { 34 | "1": { 35 | "id": 1, 36 | "num": 99 37 | }, 38 | "999": { 39 | "id": 999, 40 | "num": 99900 41 | } 42 | } 43 | } --------------------------------------------------------------------------------