(version 1000) (serializator "test1" (define "alpha_max" 100u ["alpha"]) ;; Scheme structure (procedure "alpha" (arg "alpha_lvl" (symbol (uint)) ) ) (procedure "beta" (arg "beta_lvl" (int)) ) (procedure "Test" (procedure_empty) ) (procedure "Ray" (arg "length" (uint)) (arg "width" (uint)) ) (procedure "Line" (arg "xpoint" (int)) (arg "ypoint" (int)) (arg "zpoint" (int)) ) (procedure "array" (arg "array_items" (vector (int)) ) ) ; (procedure "alpha" ; (proc "label" '("Line") (proc-allow [optional collection])) ; ) ; (wrap vector/hashmap "key") ; the content if structured like in the struct (procedure "levels" (arg "title" (string)) (proc "label1" ["alpha"] (proc-allow [optional])) (proc "label2" ["beta"]) (proc "label3" ["Ray" "Line" "Test"] (proc-allow [collection])) (proc "label5" ["array"]) ) (rootprocedure (proc "main1" ["levels"]) ) ;; Serialization ;(enum "enum title" " of procs") (enum "GeomType" ["Ray" "Line" "Test"] (jail-derive [Clone "Debug" Eq PartialEq]) ; Copy Clone Debug Eq PartialEq Hash Ord PartialOrd "other" (jail-repr Rust) ; Rust, C, "other" (jail-decl "serde(crate = \"self::serde\")") ; can be repeated multiple times (comment "The comment for the enum which is longer then 80 symbols long and shoule be separated into \ two lines of comments") (enum-opt-empty "Test" (comment "test") ) (enum-opt-struct "Ray" (enum-opt-rename "Ray") (enum-opt-fields (field "l" (f/uint64 ["length"])) (field "w" (f/uint64 ["width"])) ) ) (enum-opt-tuple "Line" (enum-opt-fields (field anon (f/int64 ["xpoint"])) (field anon (f/int64 ["zpoint"])) (field anon (f/int64 ["ypoint"])) ) ) ) ; (struct "struct title" "procedure title") (struct "Levels" "levels" (jail-derive [Clone "Debug" Eq PartialEq]) ; Copy Clone Debug Eq PartialEq Hash Ord PartialOrd "other" (jail-repr Rust) ; Rust, C, "other" (jail-decl "serde(crate = \"self::serde\")") ; can be repeated multiple times (field "name" (f/string ["title"])) (field "ch_a" (f/optional (f/uint32 ["label1" "alpha_lvl"])) ) (field "ch_b" (f/int64 ["label2" "beta_lvl"])) (field "g_type" (f/vector (f/enum ["label3"]))) (field "arr" (f/vector (f/int32 ["label5" "array_items"]))) ) ; for enum (field/noname f/enum '("label3")) ;root "title of the Struct" (fields...) (rootstruct "CommonLevels" (jail-derive [Clone "Debug" Eq PartialEq]) ; Copy Clone Debug Eq PartialEq Hash Ord PartialOrd "other" (jail-repr Rust) ; Rust, C, "other" (jail-decl "serde(crate = \"self::serde\")") ; can be repeated multiple times (field "lvl" (f/struct ["main1"])) ) )