Code generator for vigoo/desert: derives BinaryCodec implementations from #desert(binary_codec) annotations
moon run codegen -- <absolute path to your package directory>moon check # type check
moon test # unit tests for the parser/emitter pipeline
moon fmtpub suberror CodegenError {
CodegenError(String)
}pub(all) struct CaseIR {
name : String
arity : Int
option_flags : Array[Bool]
steps : Array[EvolutionIR]
transient : Bool
transparent : Bool
}pub(all) struct DeriveOptions {
transparent : Bool
sorted_constructors : Bool
type_id : String?
steps : Array[EvolutionIR]
}pub(all) enum EvolutionIR {
FieldAddedIR(String, String)
FieldMadeOptionalIR(String)
FieldRemovedIR(String)
FieldMadeTransientIR(String)
}pub(all) struct FieldIR {
name : String
is_option : Bool
transient_default : String?
added_default : String?
}pub(all) struct StructIR {
name : String
fields : Array[FieldIR]
steps : Array[EvolutionIR]
transparent : Bool
type_id : String?
}fn is_binary_codec_attr(raw : String) -> Boolfn lowercase_first(s : String) -> StringInstall
Download zipCode generator for vigoo/desert: derives BinaryCodec implementations from #desert(binary_codec) annotations