2021-06-28 14:35:45 +00:00
#![ allow(unused_parens) ]
2021-06-30 13:50:50 +00:00
#![ allow(unused_imports) ]
2021-06-28 14:35:45 +00:00
use std ::convert ::TryFrom ;
2021-07-02 05:59:36 +00:00
use preserves ::value ::Embeddable ;
2021-06-28 20:25:41 +00:00
use preserves ::value ::NestedValue ;
2021-06-30 13:50:50 +00:00
use crate ::support as _support ;
2021-06-28 14:35:45 +00:00
2021-07-02 05:48:52 +00:00
mod _io_ {
use super ::_Any ;
use preserves ::value ::NestedValue ;
use preserves ::value ::packed ::from_bytes ;
use crate ::support as _support ;
_support ::lazy_static! {
pub static ref LIT_15_FALSE : preserves ::value ::IOValue = /* #f */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 128 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_28_1 : preserves ::value ::IOValue = /* 1 */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 145 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_0_BOOLEAN : preserves ::value ::IOValue = /* Boolean */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 7 , 66 , 111 , 111 , 108 , 101 , 97 , 110 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_5_BYTE_STRING : preserves ::value ::IOValue = /* ByteString */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 10 , 66 , 121 , 116 , 101 , 83 , 116 , 114 , 105 , 110 , 103 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_2_DOUBLE : preserves ::value ::IOValue = /* Double */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 68 , 111 , 117 , 98 , 108 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_1_FLOAT : preserves ::value ::IOValue = /* Float */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 70 , 108 , 111 , 97 , 116 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_3_SIGNED_INTEGER : preserves ::value ::IOValue = /* SignedInteger */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 13 , 83 , 105 , 103 , 110 , 101 , 100 , 73 , 110 , 116 , 101 , 103 , 101 , 114 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_4_STRING : preserves ::value ::IOValue = /* String */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 83 , 116 , 114 , 105 , 110 , 103 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_6_SYMBOL : preserves ::value ::IOValue = /* Symbol */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 83 , 121 , 109 , 98 , 111 , 108 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_14_AND : preserves ::value ::IOValue = /* and */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 97 , 110 , 100 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_21_ANY : preserves ::value ::IOValue = /* any */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 97 , 110 , 121 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_22_ATOM : preserves ::value ::IOValue = /* atom */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 4 , 97 , 116 , 111 , 109 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_8_BUNDLE : preserves ::value ::IOValue = /* bundle */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 98 , 117 , 110 , 100 , 108 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_18_DEFINITIONS : preserves ::value ::IOValue = /* definitions */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 11 , 100 , 101 , 102 , 105 , 110 , 105 , 116 , 105 , 111 , 110 , 115 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_12_DICT : preserves ::value ::IOValue = /* dict */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 4 , 100 , 105 , 99 , 116 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_27_DICTOF : preserves ::value ::IOValue = /* dictof */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 100 , 105 , 99 , 116 , 111 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_23_EMBEDDED : preserves ::value ::IOValue = /* embedded */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 8 , 101 , 109 , 98 , 101 , 100 , 100 , 101 , 100 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_19_EMBEDDED_TYPE : preserves ::value ::IOValue = /* embeddedType */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 12 , 101 , 109 , 98 , 101 , 100 , 100 , 101 , 100 , 84 , 121 , 112 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_24_LIT : preserves ::value ::IOValue = /* lit */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 108 , 105 , 116 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_7_NAMED : preserves ::value ::IOValue = /* named */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 110 , 97 , 109 , 101 , 100 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_13_OR : preserves ::value ::IOValue = /* or */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 2 , 111 , 114 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_9_REC : preserves ::value ::IOValue = /* rec */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 114 , 101 , 99 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_16_REF : preserves ::value ::IOValue = /* ref */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 114 , 101 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_17_SCHEMA : preserves ::value ::IOValue = /* schema */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 115 , 99 , 104 , 101 , 109 , 97 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_25_SEQOF : preserves ::value ::IOValue = /* seqof */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 115 , 101 , 113 , 111 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_26_SETOF : preserves ::value ::IOValue = /* setof */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 115 , 101 , 116 , 111 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_10_TUPLE : preserves ::value ::IOValue = /* tuple */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 116 , 117 , 112 , 108 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_11_TUPLE_PREFIX : preserves ::value ::IOValue = /* tuplePrefix */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 11 , 116 , 117 , 112 , 108 , 101 , 80 , 114 , 101 , 102 , 105 , 120 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_20_VERSION : preserves ::value ::IOValue = /* version */ preserves ::value ::IOValue ::from_io_value ( & from_bytes ( & vec! [ 179 , 7 , 118 , 101 , 114 , 115 , 105 , 111 , 110 ] ) . unwrap ( ) ) . unwrap ( ) ;
}
}
mod _any_ {
use super ::_Any ;
use preserves ::value ::NestedValue ;
use preserves ::value ::packed ::from_bytes ;
use crate ::support as _support ;
_support ::lazy_static! {
pub static ref LIT_15_FALSE : _Any = /* #f */ _Any ::from_io_value ( & from_bytes ( & vec! [ 128 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_28_1 : _Any = /* 1 */ _Any ::from_io_value ( & from_bytes ( & vec! [ 145 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_0_BOOLEAN : _Any = /* Boolean */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 7 , 66 , 111 , 111 , 108 , 101 , 97 , 110 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_5_BYTE_STRING : _Any = /* ByteString */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 10 , 66 , 121 , 116 , 101 , 83 , 116 , 114 , 105 , 110 , 103 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_2_DOUBLE : _Any = /* Double */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 68 , 111 , 117 , 98 , 108 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_1_FLOAT : _Any = /* Float */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 70 , 108 , 111 , 97 , 116 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_3_SIGNED_INTEGER : _Any = /* SignedInteger */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 13 , 83 , 105 , 103 , 110 , 101 , 100 , 73 , 110 , 116 , 101 , 103 , 101 , 114 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_4_STRING : _Any = /* String */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 83 , 116 , 114 , 105 , 110 , 103 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_6_SYMBOL : _Any = /* Symbol */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 83 , 121 , 109 , 98 , 111 , 108 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_14_AND : _Any = /* and */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 97 , 110 , 100 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_21_ANY : _Any = /* any */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 97 , 110 , 121 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_22_ATOM : _Any = /* atom */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 4 , 97 , 116 , 111 , 109 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_8_BUNDLE : _Any = /* bundle */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 98 , 117 , 110 , 100 , 108 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_18_DEFINITIONS : _Any = /* definitions */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 11 , 100 , 101 , 102 , 105 , 110 , 105 , 116 , 105 , 111 , 110 , 115 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_12_DICT : _Any = /* dict */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 4 , 100 , 105 , 99 , 116 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_27_DICTOF : _Any = /* dictof */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 100 , 105 , 99 , 116 , 111 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_23_EMBEDDED : _Any = /* embedded */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 8 , 101 , 109 , 98 , 101 , 100 , 100 , 101 , 100 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_19_EMBEDDED_TYPE : _Any = /* embeddedType */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 12 , 101 , 109 , 98 , 101 , 100 , 100 , 101 , 100 , 84 , 121 , 112 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_24_LIT : _Any = /* lit */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 108 , 105 , 116 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_7_NAMED : _Any = /* named */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 110 , 97 , 109 , 101 , 100 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_13_OR : _Any = /* or */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 2 , 111 , 114 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_9_REC : _Any = /* rec */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 114 , 101 , 99 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_16_REF : _Any = /* ref */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 3 , 114 , 101 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_17_SCHEMA : _Any = /* schema */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 6 , 115 , 99 , 104 , 101 , 109 , 97 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_25_SEQOF : _Any = /* seqof */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 115 , 101 , 113 , 111 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_26_SETOF : _Any = /* setof */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 115 , 101 , 116 , 111 , 102 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_10_TUPLE : _Any = /* tuple */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 5 , 116 , 117 , 112 , 108 , 101 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_11_TUPLE_PREFIX : _Any = /* tuplePrefix */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 11 , 116 , 117 , 112 , 108 , 101 , 80 , 114 , 101 , 102 , 105 , 120 ] ) . unwrap ( ) ) . unwrap ( ) ;
pub static ref LIT_20_VERSION : _Any = /* version */ _Any ::from_io_value ( & from_bytes ( & vec! [ 179 , 7 , 118 , 101 , 114 , 115 , 105 , 111 , 110 ] ) . unwrap ( ) ) . unwrap ( ) ;
}
2021-06-28 14:35:45 +00:00
}
2021-06-29 21:19:22 +00:00
pub type _Ptr = preserves ::value ::IOValue ;
2021-06-30 07:53:32 +00:00
pub type _Any = preserves ::value ::ArcValue < _Ptr > ;
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum AtomKind { Boolean , Float , Double , SignedInteger , String , ByteString , Symbol }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:26:41 +00:00
pub struct Binding { pub name : std ::string ::String , pub pattern : SimplePattern }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:26:41 +00:00
pub struct Bundle { pub modules : Modules }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum CompoundPattern {
2021-06-28 14:35:45 +00:00
Rec { label : std ::boxed ::Box < NamedPattern > , fields : std ::boxed ::Box < NamedPattern > } ,
Tuple { patterns : std ::vec ::Vec < NamedPattern > } ,
TuplePrefix {
fixed : std ::vec ::Vec < NamedPattern > ,
variable : std ::boxed ::Box < NamedSimplePattern >
} ,
Dict { entries : std ::boxed ::Box < DictionaryEntries > }
}
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum Definition {
2021-06-28 14:35:45 +00:00
Or {
pattern_0 : std ::boxed ::Box < NamedAlternative > ,
pattern_1 : std ::boxed ::Box < NamedAlternative > ,
pattern_n : std ::vec ::Vec < NamedAlternative >
} ,
And {
pattern_0 : std ::boxed ::Box < NamedPattern > ,
pattern_1 : std ::boxed ::Box < NamedPattern > ,
pattern_n : std ::vec ::Vec < NamedPattern >
} ,
Pattern ( std ::boxed ::Box < Pattern > )
}
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub struct Definitions ( pub preserves ::value ::Map < std ::string ::String , Definition > ) ;
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
pub struct DictionaryEntries ( pub preserves ::value ::Map < _Any , NamedSimplePattern > ) ;
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum EmbeddedTypeName { Ref ( std ::boxed ::Box < Ref > ) , False }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub struct ModulePath ( pub std ::vec ::Vec < std ::string ::String > ) ;
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub struct Modules ( pub preserves ::value ::Map < ModulePath , Schema > ) ;
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:26:41 +00:00
pub struct NamedAlternative { pub variant_label : std ::string ::String , pub pattern : Pattern }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum NamedPattern { Named ( std ::boxed ::Box < Binding > ) , Anonymous ( std ::boxed ::Box < Pattern > ) }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum NamedSimplePattern { Named ( std ::boxed ::Box < Binding > ) , Anonymous ( std ::boxed ::Box < SimplePattern > ) }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum Pattern {
2021-06-28 14:35:45 +00:00
SimplePattern ( std ::boxed ::Box < SimplePattern > ) ,
CompoundPattern ( std ::boxed ::Box < CompoundPattern > )
}
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:26:41 +00:00
pub struct Ref { pub module : ModulePath , pub name : std ::string ::String }
2021-06-28 14:35:45 +00:00
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub struct Schema {
2021-06-28 15:26:41 +00:00
pub definitions : Definitions ,
pub embedded_type : EmbeddedTypeName ,
pub version : Version
2021-06-28 14:35:45 +00:00
}
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub enum SimplePattern {
2021-06-28 14:35:45 +00:00
Any ,
Atom { atom_kind : std ::boxed ::Box < AtomKind > } ,
Embedded { interface : std ::boxed ::Box < SimplePattern > } ,
2021-06-30 07:53:32 +00:00
Lit { value : _Any } ,
2021-06-28 14:35:45 +00:00
Seqof { pattern : std ::boxed ::Box < SimplePattern > } ,
Setof { pattern : std ::boxed ::Box < SimplePattern > } ,
Dictof { key : std ::boxed ::Box < SimplePattern > , value : std ::boxed ::Box < SimplePattern > } ,
Ref ( std ::boxed ::Box < Ref > )
}
2021-06-30 07:53:32 +00:00
#[ derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Hash) ]
2021-06-28 15:08:44 +00:00
pub struct Version ;
2021-06-28 14:35:45 +00:00
2021-07-02 05:48:52 +00:00
fn _io_parse_atom_kind_boolean ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _io_ ::LIT_0_BOOLEAN { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 13:50:50 +00:00
let _tmp0 = ( ) ;
Ok ( AtomKind ::Boolean )
}
2021-06-28 14:35:45 +00:00
2021-07-02 05:48:52 +00:00
fn _io_parse_atom_kind_float ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _io_ ::LIT_1_FLOAT { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 13:50:50 +00:00
let _tmp0 = ( ) ;
Ok ( AtomKind ::Float )
}
2021-06-28 14:35:45 +00:00
2021-07-02 05:48:52 +00:00
fn _io_parse_atom_kind_double ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _io_ ::LIT_2_DOUBLE { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 13:50:50 +00:00
let _tmp0 = ( ) ;
Ok ( AtomKind ::Double )
}
2021-06-28 14:35:45 +00:00
2021-07-02 05:48:52 +00:00
fn _io_parse_atom_kind_signed_integer ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _io_ ::LIT_3_SIGNED_INTEGER { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 14:35:45 +00:00
let _tmp0 = ( ) ;
Ok ( AtomKind ::SignedInteger )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_atom_kind_string ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _io_ ::LIT_4_STRING { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 13:50:50 +00:00
let _tmp0 = ( ) ;
Ok ( AtomKind ::String )
}
2021-06-28 14:35:45 +00:00
2021-07-02 05:48:52 +00:00
fn _io_parse_atom_kind_byte_string ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _io_ ::LIT_5_BYTE_STRING { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 14:35:45 +00:00
let _tmp0 = ( ) ;
Ok ( AtomKind ::ByteString )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_atom_kind_symbol ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _io_ ::LIT_6_SYMBOL { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 13:50:50 +00:00
let _tmp0 = ( ) ;
Ok ( AtomKind ::Symbol )
}
2021-06-28 14:35:45 +00:00
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for AtomKind {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_atom_kind_boolean ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_atom_kind_float ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_atom_kind_double ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_atom_kind_signed_integer ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_atom_kind_string ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_atom_kind_byte_string ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_atom_kind_symbol ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & AtomKind > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & AtomKind ) -> Self {
match value {
2021-07-02 05:48:52 +00:00
AtomKind ::Boolean = > ( & * _io_ ::LIT_0_BOOLEAN ) . clone ( ) ,
AtomKind ::Float = > ( & * _io_ ::LIT_1_FLOAT ) . clone ( ) ,
AtomKind ::Double = > ( & * _io_ ::LIT_2_DOUBLE ) . clone ( ) ,
AtomKind ::SignedInteger = > ( & * _io_ ::LIT_3_SIGNED_INTEGER ) . clone ( ) ,
AtomKind ::String = > ( & * _io_ ::LIT_4_STRING ) . clone ( ) ,
AtomKind ::ByteString = > ( & * _io_ ::LIT_5_BYTE_STRING ) . clone ( ) ,
AtomKind ::Symbol = > ( & * _io_ ::LIT_6_SYMBOL ) . clone ( ) ,
}
}
}
fn _any_parse_atom_kind_boolean ( value : & _Any ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _any_ ::LIT_0_BOOLEAN { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( AtomKind ::Boolean )
}
fn _any_parse_atom_kind_float ( value : & _Any ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _any_ ::LIT_1_FLOAT { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( AtomKind ::Float )
}
fn _any_parse_atom_kind_double ( value : & _Any ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _any_ ::LIT_2_DOUBLE { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( AtomKind ::Double )
}
fn _any_parse_atom_kind_signed_integer ( value : & _Any ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _any_ ::LIT_3_SIGNED_INTEGER { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( AtomKind ::SignedInteger )
}
fn _any_parse_atom_kind_string ( value : & _Any ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _any_ ::LIT_4_STRING { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( AtomKind ::String )
}
fn _any_parse_atom_kind_byte_string ( value : & _Any ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _any_ ::LIT_5_BYTE_STRING { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( AtomKind ::ByteString )
}
fn _any_parse_atom_kind_symbol ( value : & _Any ) -> std ::result ::Result < AtomKind , _support ::ParseError > {
if value ! = & * _any_ ::LIT_6_SYMBOL { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( AtomKind ::Symbol )
}
impl std ::convert ::TryFrom < _Any > for AtomKind {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_atom_kind_boolean ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_atom_kind_float ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_atom_kind_double ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_atom_kind_signed_integer ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_atom_kind_string ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_atom_kind_byte_string ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_atom_kind_symbol ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & AtomKind > for _Any {
fn from ( value : & AtomKind ) -> Self {
match value {
AtomKind ::Boolean = > ( & * _any_ ::LIT_0_BOOLEAN ) . clone ( ) ,
AtomKind ::Float = > ( & * _any_ ::LIT_1_FLOAT ) . clone ( ) ,
AtomKind ::Double = > ( & * _any_ ::LIT_2_DOUBLE ) . clone ( ) ,
AtomKind ::SignedInteger = > ( & * _any_ ::LIT_3_SIGNED_INTEGER ) . clone ( ) ,
AtomKind ::String = > ( & * _any_ ::LIT_4_STRING ) . clone ( ) ,
AtomKind ::ByteString = > ( & * _any_ ::LIT_5_BYTE_STRING ) . clone ( ) ,
AtomKind ::Symbol = > ( & * _any_ ::LIT_6_SYMBOL ) . clone ( ) ,
2021-06-29 14:54:29 +00:00
}
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Binding {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_7_NAMED { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_symbol ( ) ? ;
2021-06-30 07:53:32 +00:00
let _tmp3 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( Binding { name : _tmp2 . clone ( ) , pattern : _tmp3 } )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Binding > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Binding ) -> Self {
let Binding { name : _tmp0 , pattern : _tmp1 } = value ;
{
2021-07-02 05:48:52 +00:00
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_7_NAMED ) . clone ( ) ] ) ;
2021-06-29 14:54:29 +00:00
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::Value ::symbol ( _tmp0 ) . wrap ( ) ) ;
2021-06-30 13:18:20 +00:00
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp1 ) ) ;
2021-06-29 14:54:29 +00:00
_tmp2 . finish ( ) . wrap ( )
}
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for Binding {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_7_NAMED { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_symbol ( ) ? ;
let _tmp3 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
Ok ( Binding { name : _tmp2 . clone ( ) , pattern : _tmp3 } )
}
}
impl std ::convert ::From < & Binding > for _Any {
fn from ( value : & Binding ) -> Self {
let Binding { name : _tmp0 , pattern : _tmp1 } = value ;
{
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_7_NAMED ) . clone ( ) ] ) ;
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::Value ::symbol ( _tmp0 ) . wrap ( ) ) ;
_tmp2 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp1 ) ) ;
_tmp2 . finish ( ) . wrap ( )
}
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Bundle {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_8_BUNDLE { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = Modules ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( Bundle { modules : _tmp2 } )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Bundle > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Bundle ) -> Self {
let Bundle { modules : _tmp0 } = value ;
{
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_8_BUNDLE ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp1 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 ) ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . finish ( ) . wrap ( )
}
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for Bundle {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_8_BUNDLE { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = Modules ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
Ok ( Bundle { modules : _tmp2 } )
}
}
impl std ::convert ::From < & Bundle > for _Any {
fn from ( value : & Bundle ) -> Self {
let Bundle { modules : _tmp0 } = value ;
{
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_8_BUNDLE ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 ) ) ;
_tmp1 . finish ( ) . wrap ( )
}
}
}
fn _io_parse_compound_pattern_rec ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_9_REC { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = NamedPattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
let _tmp3 = NamedPattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( CompoundPattern ::Rec { label : std ::boxed ::Box ::new ( _tmp2 ) , fields : std ::boxed ::Box ::new ( _tmp3 ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_compound_pattern_tuple ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_10_TUPLE { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp3 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
2021-06-28 20:25:41 +00:00
let mut _tmp2 = std ::vec ::Vec ::new ( ) ;
2021-06-30 07:53:32 +00:00
for _tmp4 in & _tmp3 [ 0 .. ] { let _tmp5 = NamedPattern ::try_from ( _tmp4 . clone ( ) ) ? ; _tmp2 . push ( _tmp5 ) ; }
2021-06-28 20:25:41 +00:00
Ok ( CompoundPattern ::Tuple { patterns : _tmp2 } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_compound_pattern_tuple_prefix ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_11_TUPLE_PREFIX { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp3 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
2021-06-28 20:25:41 +00:00
let mut _tmp2 = std ::vec ::Vec ::new ( ) ;
2021-06-30 07:53:32 +00:00
for _tmp4 in & _tmp3 [ 0 .. ] { let _tmp5 = NamedPattern ::try_from ( _tmp4 . clone ( ) ) ? ; _tmp2 . push ( _tmp5 ) ; }
let _tmp6 = NamedSimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( CompoundPattern ::TuplePrefix { fixed : _tmp2 , variable : std ::boxed ::Box ::new ( _tmp6 ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_compound_pattern_dict ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_12_DICT { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = DictionaryEntries ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( CompoundPattern ::Dict { entries : std ::boxed ::Box ::new ( _tmp2 ) } )
2021-06-28 14:35:45 +00:00
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for CompoundPattern {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_compound_pattern_rec ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_compound_pattern_tuple ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_compound_pattern_tuple_prefix ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_compound_pattern_dict ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & CompoundPattern > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & CompoundPattern ) -> Self {
match value {
CompoundPattern ::Rec { label : _tmp0 , fields : _tmp1 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_9_REC ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp1 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp2 . finish ( ) . wrap ( )
} ,
CompoundPattern ::Tuple { patterns : _tmp0 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_10_TUPLE ) . clone ( ) ] ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . fields_vec_mut ( ) . push (
{
let mut _tmp2 = vec! [ ] ;
2021-06-30 13:18:20 +00:00
for _tmp3 in _tmp0 { _tmp2 . push ( preserves ::value ::IOValue ::from ( _tmp3 ) ) ; }
2021-06-29 14:54:29 +00:00
preserves ::value ::Value ::Sequence ( _tmp2 ) . wrap ( )
}
) ;
_tmp1 . finish ( ) . wrap ( )
} ,
CompoundPattern ::TuplePrefix { fixed : _tmp0 , variable : _tmp1 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_11_TUPLE_PREFIX ) . clone ( ) ] ) ;
2021-06-29 14:54:29 +00:00
_tmp2 . fields_vec_mut ( ) . push (
{
let mut _tmp3 = vec! [ ] ;
2021-06-30 13:18:20 +00:00
for _tmp4 in _tmp0 { _tmp3 . push ( preserves ::value ::IOValue ::from ( _tmp4 ) ) ; }
2021-06-29 14:54:29 +00:00
preserves ::value ::Value ::Sequence ( _tmp3 ) . wrap ( )
}
) ;
2021-06-30 13:18:20 +00:00
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp1 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp2 . finish ( ) . wrap ( )
} ,
CompoundPattern ::Dict { entries : _tmp0 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_12_DICT ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp1 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . finish ( ) . wrap ( )
} ,
}
}
}
2021-07-02 05:48:52 +00:00
fn _any_parse_compound_pattern_rec ( value : & _Any ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_9_REC { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = NamedPattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
let _tmp3 = NamedPattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
Ok ( CompoundPattern ::Rec { label : std ::boxed ::Box ::new ( _tmp2 ) , fields : std ::boxed ::Box ::new ( _tmp3 ) } )
}
fn _any_parse_compound_pattern_tuple ( value : & _Any ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_10_TUPLE { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp3 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
let mut _tmp2 = std ::vec ::Vec ::new ( ) ;
for _tmp4 in & _tmp3 [ 0 .. ] { let _tmp5 = NamedPattern ::try_from ( _tmp4 . clone ( ) ) ? ; _tmp2 . push ( _tmp5 ) ; }
Ok ( CompoundPattern ::Tuple { patterns : _tmp2 } )
}
fn _any_parse_compound_pattern_tuple_prefix ( value : & _Any ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_11_TUPLE_PREFIX { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp3 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
let mut _tmp2 = std ::vec ::Vec ::new ( ) ;
for _tmp4 in & _tmp3 [ 0 .. ] { let _tmp5 = NamedPattern ::try_from ( _tmp4 . clone ( ) ) ? ; _tmp2 . push ( _tmp5 ) ; }
let _tmp6 = NamedSimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
Ok ( CompoundPattern ::TuplePrefix { fixed : _tmp2 , variable : std ::boxed ::Box ::new ( _tmp6 ) } )
}
fn _any_parse_compound_pattern_dict ( value : & _Any ) -> std ::result ::Result < CompoundPattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_12_DICT { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = DictionaryEntries ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
Ok ( CompoundPattern ::Dict { entries : std ::boxed ::Box ::new ( _tmp2 ) } )
}
impl std ::convert ::TryFrom < _Any > for CompoundPattern {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_compound_pattern_rec ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_compound_pattern_tuple ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_compound_pattern_tuple_prefix ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_compound_pattern_dict ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & CompoundPattern > for _Any {
fn from ( value : & CompoundPattern ) -> Self {
match value {
CompoundPattern ::Rec { label : _tmp0 , fields : _tmp1 } = > {
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_9_REC ) . clone ( ) ] ) ;
_tmp2 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp2 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp1 . as_ref ( ) ) ) ;
_tmp2 . finish ( ) . wrap ( )
} ,
CompoundPattern ::Tuple { patterns : _tmp0 } = > {
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_10_TUPLE ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push (
{
let mut _tmp2 = vec! [ ] ;
for _tmp3 in _tmp0 { _tmp2 . push ( _Any ::from ( _tmp3 ) ) ; }
preserves ::value ::Value ::Sequence ( _tmp2 ) . wrap ( )
}
) ;
_tmp1 . finish ( ) . wrap ( )
} ,
CompoundPattern ::TuplePrefix { fixed : _tmp0 , variable : _tmp1 } = > {
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_11_TUPLE_PREFIX ) . clone ( ) ] ) ;
_tmp2 . fields_vec_mut ( ) . push (
{
let mut _tmp3 = vec! [ ] ;
for _tmp4 in _tmp0 { _tmp3 . push ( _Any ::from ( _tmp4 ) ) ; }
preserves ::value ::Value ::Sequence ( _tmp3 ) . wrap ( )
}
) ;
_tmp2 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp1 . as_ref ( ) ) ) ;
_tmp2 . finish ( ) . wrap ( )
} ,
CompoundPattern ::Dict { entries : _tmp0 } = > {
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_12_DICT ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp1 . finish ( ) . wrap ( )
} ,
}
}
}
fn _io_parse_definition_or ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < Definition , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_13_OR { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
if _tmp2 . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp3 = NamedAlternative ::try_from ( ( & _tmp2 [ 0 ] ) . clone ( ) ) ? ;
let _tmp4 = NamedAlternative ::try_from ( ( & _tmp2 [ 1 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
let mut _tmp5 = std ::vec ::Vec ::new ( ) ;
2021-06-30 07:53:32 +00:00
for _tmp6 in & _tmp2 [ 2 .. ] { let _tmp7 = NamedAlternative ::try_from ( _tmp6 . clone ( ) ) ? ; _tmp5 . push ( _tmp7 ) ; }
2021-06-28 14:35:45 +00:00
Ok ( Definition ::Or {
2021-06-28 20:25:41 +00:00
pattern_0 : std ::boxed ::Box ::new ( _tmp3 ) ,
pattern_1 : std ::boxed ::Box ::new ( _tmp4 ) ,
pattern_n : _tmp5
2021-06-28 14:35:45 +00:00
} )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_definition_and ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < Definition , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_14_AND { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
if _tmp2 . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp3 = NamedPattern ::try_from ( ( & _tmp2 [ 0 ] ) . clone ( ) ) ? ;
let _tmp4 = NamedPattern ::try_from ( ( & _tmp2 [ 1 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
let mut _tmp5 = std ::vec ::Vec ::new ( ) ;
2021-06-30 07:53:32 +00:00
for _tmp6 in & _tmp2 [ 2 .. ] { let _tmp7 = NamedPattern ::try_from ( _tmp6 . clone ( ) ) ? ; _tmp5 . push ( _tmp7 ) ; }
2021-06-28 14:35:45 +00:00
Ok ( Definition ::And {
2021-06-28 20:25:41 +00:00
pattern_0 : std ::boxed ::Box ::new ( _tmp3 ) ,
pattern_1 : std ::boxed ::Box ::new ( _tmp4 ) ,
pattern_n : _tmp5
2021-06-28 14:35:45 +00:00
} )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_definition_pattern ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < Definition , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = Pattern ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( Definition ::Pattern ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Definition {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_definition_or ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_definition_and ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_definition_pattern ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Definition > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Definition ) -> Self {
match value {
Definition ::Or { pattern_0 : _tmp0 , pattern_1 : _tmp1 , pattern_n : _tmp2 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp3 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_13_OR ) . clone ( ) ] ) ;
2021-06-29 14:54:29 +00:00
_tmp3 . fields_vec_mut ( ) . push (
{
let mut _tmp4 = vec! [ ] ;
2021-06-30 13:18:20 +00:00
_tmp4 . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp4 . push ( preserves ::value ::IOValue ::from ( _tmp1 . as_ref ( ) ) ) ;
for _tmp5 in _tmp2 { _tmp4 . push ( preserves ::value ::IOValue ::from ( _tmp5 ) ) ; }
2021-06-29 14:54:29 +00:00
preserves ::value ::Value ::Sequence ( _tmp4 ) . wrap ( )
}
) ;
_tmp3 . finish ( ) . wrap ( )
} ,
Definition ::And { pattern_0 : _tmp0 , pattern_1 : _tmp1 , pattern_n : _tmp2 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp3 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_14_AND ) . clone ( ) ] ) ;
2021-06-29 14:54:29 +00:00
_tmp3 . fields_vec_mut ( ) . push (
{
let mut _tmp4 = vec! [ ] ;
2021-06-30 13:18:20 +00:00
_tmp4 . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp4 . push ( preserves ::value ::IOValue ::from ( _tmp1 . as_ref ( ) ) ) ;
for _tmp5 in _tmp2 { _tmp4 . push ( preserves ::value ::IOValue ::from ( _tmp5 ) ) ; }
2021-06-29 14:54:29 +00:00
preserves ::value ::Value ::Sequence ( _tmp4 ) . wrap ( )
}
) ;
_tmp3 . finish ( ) . wrap ( )
} ,
2021-06-30 13:18:20 +00:00
Definition ::Pattern ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
2021-06-29 14:54:29 +00:00
}
}
}
2021-07-02 05:48:52 +00:00
fn _any_parse_definition_or ( value : & _Any ) -> std ::result ::Result < Definition , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_13_OR { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
if _tmp2 . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp3 = NamedAlternative ::try_from ( ( & _tmp2 [ 0 ] ) . clone ( ) ) ? ;
let _tmp4 = NamedAlternative ::try_from ( ( & _tmp2 [ 1 ] ) . clone ( ) ) ? ;
let mut _tmp5 = std ::vec ::Vec ::new ( ) ;
for _tmp6 in & _tmp2 [ 2 .. ] { let _tmp7 = NamedAlternative ::try_from ( _tmp6 . clone ( ) ) ? ; _tmp5 . push ( _tmp7 ) ; }
Ok ( Definition ::Or {
pattern_0 : std ::boxed ::Box ::new ( _tmp3 ) ,
pattern_1 : std ::boxed ::Box ::new ( _tmp4 ) ,
pattern_n : _tmp5
} )
}
fn _any_parse_definition_and ( value : & _Any ) -> std ::result ::Result < Definition , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_14_AND { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_sequence ( ) ? ;
if _tmp2 . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp3 = NamedPattern ::try_from ( ( & _tmp2 [ 0 ] ) . clone ( ) ) ? ;
let _tmp4 = NamedPattern ::try_from ( ( & _tmp2 [ 1 ] ) . clone ( ) ) ? ;
let mut _tmp5 = std ::vec ::Vec ::new ( ) ;
for _tmp6 in & _tmp2 [ 2 .. ] { let _tmp7 = NamedPattern ::try_from ( _tmp6 . clone ( ) ) ? ; _tmp5 . push ( _tmp7 ) ; }
Ok ( Definition ::And {
pattern_0 : std ::boxed ::Box ::new ( _tmp3 ) ,
pattern_1 : std ::boxed ::Box ::new ( _tmp4 ) ,
pattern_n : _tmp5
} )
}
fn _any_parse_definition_pattern ( value : & _Any ) -> std ::result ::Result < Definition , _support ::ParseError > {
let _tmp0 = Pattern ::try_from ( value . clone ( ) ) ? ;
Ok ( Definition ::Pattern ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
impl std ::convert ::TryFrom < _Any > for Definition {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_definition_or ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_definition_and ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_definition_pattern ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & Definition > for _Any {
fn from ( value : & Definition ) -> Self {
match value {
Definition ::Or { pattern_0 : _tmp0 , pattern_1 : _tmp1 , pattern_n : _tmp2 } = > {
let mut _tmp3 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_13_OR ) . clone ( ) ] ) ;
_tmp3 . fields_vec_mut ( ) . push (
{
let mut _tmp4 = vec! [ ] ;
_tmp4 . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp4 . push ( _Any ::from ( _tmp1 . as_ref ( ) ) ) ;
for _tmp5 in _tmp2 { _tmp4 . push ( _Any ::from ( _tmp5 ) ) ; }
preserves ::value ::Value ::Sequence ( _tmp4 ) . wrap ( )
}
) ;
_tmp3 . finish ( ) . wrap ( )
} ,
Definition ::And { pattern_0 : _tmp0 , pattern_1 : _tmp1 , pattern_n : _tmp2 } = > {
let mut _tmp3 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_14_AND ) . clone ( ) ] ) ;
_tmp3 . fields_vec_mut ( ) . push (
{
let mut _tmp4 = vec! [ ] ;
_tmp4 . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp4 . push ( _Any ::from ( _tmp1 . as_ref ( ) ) ) ;
for _tmp5 in _tmp2 { _tmp4 . push ( _Any ::from ( _tmp5 ) ) ; }
preserves ::value ::Value ::Sequence ( _tmp4 ) . wrap ( )
}
) ;
_tmp3 . finish ( ) . wrap ( )
} ,
Definition ::Pattern ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
}
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Definitions {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-28 14:35:45 +00:00
let mut _tmp0 = preserves ::value ::Map ::new ( ) ;
2021-06-30 13:50:50 +00:00
for ( _tmp1 , _tmp2 ) in value . value ( ) . to_dictionary ( ) ? {
let _tmp3 = _tmp1 . value ( ) . to_symbol ( ) ? ;
2021-06-30 07:53:32 +00:00
let _tmp4 = Definition ::try_from ( _tmp2 . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
_tmp0 . insert ( _tmp3 . clone ( ) , _tmp4 ) ;
}
Ok ( Definitions ( _tmp0 ) )
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Definitions > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Definitions ) -> Self {
let Definitions ( _tmp0 ) = value ;
2021-06-30 13:18:20 +00:00
preserves ::value ::Value ::Dictionary ( _tmp0 . iter ( ) . map ( | ( _tmp1 , _tmp2 ) | (
preserves ::value ::Value ::symbol ( _tmp1 ) . wrap ( ) ,
preserves ::value ::IOValue ::from ( _tmp2 )
) ) . collect ( ) ) . wrap ( )
2021-06-29 14:54:29 +00:00
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for Definitions {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let mut _tmp0 = preserves ::value ::Map ::new ( ) ;
for ( _tmp1 , _tmp2 ) in value . value ( ) . to_dictionary ( ) ? {
let _tmp3 = _tmp1 . value ( ) . to_symbol ( ) ? ;
let _tmp4 = Definition ::try_from ( _tmp2 . clone ( ) ) ? ;
_tmp0 . insert ( _tmp3 . clone ( ) , _tmp4 ) ;
}
Ok ( Definitions ( _tmp0 ) )
}
}
impl std ::convert ::From < & Definitions > for _Any {
fn from ( value : & Definitions ) -> Self {
let Definitions ( _tmp0 ) = value ;
preserves ::value ::Value ::Dictionary ( _tmp0 . iter ( ) . map ( | ( _tmp1 , _tmp2 ) | ( preserves ::value ::Value ::symbol ( _tmp1 ) . wrap ( ) , _Any ::from ( _tmp2 ) ) ) . collect ( ) ) . wrap ( )
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for DictionaryEntries {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-28 14:35:45 +00:00
let mut _tmp0 = preserves ::value ::Map ::new ( ) ;
2021-06-30 13:50:50 +00:00
for ( _tmp1 , _tmp2 ) in value . value ( ) . to_dictionary ( ) ? {
let _tmp3 = _Any ::from_io_value ( _tmp1 ) ? ;
2021-06-30 07:53:32 +00:00
let _tmp4 = NamedSimplePattern ::try_from ( _tmp2 . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
_tmp0 . insert ( _tmp3 . clone ( ) , _tmp4 ) ;
}
Ok ( DictionaryEntries ( _tmp0 ) )
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & DictionaryEntries > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & DictionaryEntries ) -> Self {
let DictionaryEntries ( _tmp0 ) = value ;
2021-06-30 13:18:20 +00:00
preserves ::value ::Value ::Dictionary ( _tmp0 . iter ( ) . map ( | ( _tmp1 , _tmp2 ) | ( _tmp1 . to_io_value ( ) , preserves ::value ::IOValue ::from ( _tmp2 ) ) ) . collect ( ) ) . wrap ( )
2021-06-29 14:54:29 +00:00
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for DictionaryEntries {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let mut _tmp0 = preserves ::value ::Map ::new ( ) ;
for ( _tmp1 , _tmp2 ) in value . value ( ) . to_dictionary ( ) ? {
let _tmp3 = _tmp1 ;
let _tmp4 = NamedSimplePattern ::try_from ( _tmp2 . clone ( ) ) ? ;
_tmp0 . insert ( _tmp3 . clone ( ) , _tmp4 ) ;
}
Ok ( DictionaryEntries ( _tmp0 ) )
}
}
impl std ::convert ::From < & DictionaryEntries > for _Any {
fn from ( value : & DictionaryEntries ) -> Self {
let DictionaryEntries ( _tmp0 ) = value ;
preserves ::value ::Value ::Dictionary ( _tmp0 . iter ( ) . map ( | ( _tmp1 , _tmp2 ) | ( _tmp1 . clone ( ) , _Any ::from ( _tmp2 ) ) ) . collect ( ) ) . wrap ( )
}
}
fn _io_parse_embedded_type_name_ref ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < EmbeddedTypeName , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = Ref ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( EmbeddedTypeName ::Ref ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_embedded_type_name_false ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < EmbeddedTypeName , _support ::ParseError > {
if value ! = & * _io_ ::LIT_15_FALSE { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 14:35:45 +00:00
let _tmp0 = ( ) ;
Ok ( EmbeddedTypeName ::False )
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for EmbeddedTypeName {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_embedded_type_name_ref ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_embedded_type_name_false ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & EmbeddedTypeName > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & EmbeddedTypeName ) -> Self {
match value {
2021-06-30 13:18:20 +00:00
EmbeddedTypeName ::Ref ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
2021-07-02 05:48:52 +00:00
EmbeddedTypeName ::False = > ( & * _io_ ::LIT_15_FALSE ) . clone ( ) ,
2021-06-29 14:54:29 +00:00
}
}
}
2021-07-02 05:48:52 +00:00
fn _any_parse_embedded_type_name_ref ( value : & _Any ) -> std ::result ::Result < EmbeddedTypeName , _support ::ParseError > {
let _tmp0 = Ref ::try_from ( value . clone ( ) ) ? ;
Ok ( EmbeddedTypeName ::Ref ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
fn _any_parse_embedded_type_name_false ( value : & _Any ) -> std ::result ::Result < EmbeddedTypeName , _support ::ParseError > {
if value ! = & * _any_ ::LIT_15_FALSE { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( EmbeddedTypeName ::False )
}
impl std ::convert ::TryFrom < _Any > for EmbeddedTypeName {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_embedded_type_name_ref ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_embedded_type_name_false ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & EmbeddedTypeName > for _Any {
fn from ( value : & EmbeddedTypeName ) -> Self {
match value {
EmbeddedTypeName ::Ref ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
EmbeddedTypeName ::False = > ( & * _any_ ::LIT_15_FALSE ) . clone ( ) ,
}
}
}
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for ModulePath {
type Error = _support ::ParseError ;
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let _tmp1 = value . value ( ) . to_sequence ( ) ? ;
2021-06-28 14:35:45 +00:00
let mut _tmp0 = std ::vec ::Vec ::new ( ) ;
2021-06-30 13:50:50 +00:00
for _tmp2 in & _tmp1 [ 0 .. ] { let _tmp3 = _tmp2 . value ( ) . to_symbol ( ) ? ; _tmp0 . push ( _tmp3 . clone ( ) ) ; }
2021-06-28 14:35:45 +00:00
Ok ( ModulePath ( _tmp0 ) )
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & ModulePath > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & ModulePath ) -> Self {
let ModulePath ( _tmp0 ) = value ;
{
let mut _tmp1 = vec! [ ] ;
for _tmp2 in _tmp0 { _tmp1 . push ( preserves ::value ::Value ::symbol ( _tmp2 ) . wrap ( ) ) ; }
preserves ::value ::Value ::Sequence ( _tmp1 ) . wrap ( )
}
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for ModulePath {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let _tmp1 = value . value ( ) . to_sequence ( ) ? ;
let mut _tmp0 = std ::vec ::Vec ::new ( ) ;
for _tmp2 in & _tmp1 [ 0 .. ] { let _tmp3 = _tmp2 . value ( ) . to_symbol ( ) ? ; _tmp0 . push ( _tmp3 . clone ( ) ) ; }
Ok ( ModulePath ( _tmp0 ) )
}
}
impl std ::convert ::From < & ModulePath > for _Any {
fn from ( value : & ModulePath ) -> Self {
let ModulePath ( _tmp0 ) = value ;
{
let mut _tmp1 = vec! [ ] ;
for _tmp2 in _tmp0 { _tmp1 . push ( preserves ::value ::Value ::symbol ( _tmp2 ) . wrap ( ) ) ; }
preserves ::value ::Value ::Sequence ( _tmp1 ) . wrap ( )
}
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Modules {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-28 14:35:45 +00:00
let mut _tmp0 = preserves ::value ::Map ::new ( ) ;
2021-06-30 13:50:50 +00:00
for ( _tmp1 , _tmp2 ) in value . value ( ) . to_dictionary ( ) ? {
2021-06-30 07:53:32 +00:00
let _tmp3 = ModulePath ::try_from ( _tmp1 . clone ( ) ) ? ;
let _tmp4 = Schema ::try_from ( _tmp2 . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
_tmp0 . insert ( _tmp3 , _tmp4 ) ;
}
Ok ( Modules ( _tmp0 ) )
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Modules > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Modules ) -> Self {
let Modules ( _tmp0 ) = value ;
2021-06-30 13:18:20 +00:00
preserves ::value ::Value ::Dictionary ( _tmp0 . iter ( ) . map ( | ( _tmp1 , _tmp2 ) | ( preserves ::value ::IOValue ::from ( _tmp1 ) , preserves ::value ::IOValue ::from ( _tmp2 ) ) ) . collect ( ) ) . wrap ( )
2021-06-29 14:54:29 +00:00
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for Modules {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let mut _tmp0 = preserves ::value ::Map ::new ( ) ;
for ( _tmp1 , _tmp2 ) in value . value ( ) . to_dictionary ( ) ? {
let _tmp3 = ModulePath ::try_from ( _tmp1 . clone ( ) ) ? ;
let _tmp4 = Schema ::try_from ( _tmp2 . clone ( ) ) ? ;
_tmp0 . insert ( _tmp3 , _tmp4 ) ;
}
Ok ( Modules ( _tmp0 ) )
}
}
impl std ::convert ::From < & Modules > for _Any {
fn from ( value : & Modules ) -> Self {
let Modules ( _tmp0 ) = value ;
preserves ::value ::Value ::Dictionary ( _tmp0 . iter ( ) . map ( | ( _tmp1 , _tmp2 ) | ( _Any ::from ( _tmp1 ) , _Any ::from ( _tmp2 ) ) ) . collect ( ) ) . wrap ( )
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for NamedAlternative {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_sequence ( ) ? ;
if _tmp0 . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( & _tmp0 [ 0 ] ) . value ( ) . to_string ( ) ? ;
2021-06-30 07:53:32 +00:00
let _tmp2 = Pattern ::try_from ( ( & _tmp0 [ 1 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( NamedAlternative { variant_label : _tmp1 . clone ( ) , pattern : _tmp2 } )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & NamedAlternative > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & NamedAlternative ) -> Self {
let NamedAlternative { variant_label : _tmp0 , pattern : _tmp1 } = value ;
{
let mut _tmp2 = vec! [ ] ;
_tmp2 . push ( preserves ::value ::Value ::from ( _tmp0 ) . wrap ( ) ) ;
2021-06-30 13:18:20 +00:00
_tmp2 . push ( preserves ::value ::IOValue ::from ( _tmp1 ) ) ;
2021-06-29 14:54:29 +00:00
preserves ::value ::Value ::Sequence ( _tmp2 ) . wrap ( )
}
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for NamedAlternative {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let _tmp0 = value . value ( ) . to_sequence ( ) ? ;
if _tmp0 . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( & _tmp0 [ 0 ] ) . value ( ) . to_string ( ) ? ;
let _tmp2 = Pattern ::try_from ( ( & _tmp0 [ 1 ] ) . clone ( ) ) ? ;
Ok ( NamedAlternative { variant_label : _tmp1 . clone ( ) , pattern : _tmp2 } )
}
}
impl std ::convert ::From < & NamedAlternative > for _Any {
fn from ( value : & NamedAlternative ) -> Self {
let NamedAlternative { variant_label : _tmp0 , pattern : _tmp1 } = value ;
{
let mut _tmp2 = vec! [ ] ;
_tmp2 . push ( preserves ::value ::Value ::from ( _tmp0 ) . wrap ( ) ) ;
_tmp2 . push ( _Any ::from ( _tmp1 ) ) ;
preserves ::value ::Value ::Sequence ( _tmp2 ) . wrap ( )
}
}
}
fn _io_parse_named_pattern_named ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < NamedPattern , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = Binding ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( NamedPattern ::Named ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_named_pattern_anonymous ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < NamedPattern , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = Pattern ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( NamedPattern ::Anonymous ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for NamedPattern {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_named_pattern_named ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_named_pattern_anonymous ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & NamedPattern > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & NamedPattern ) -> Self {
match value {
2021-06-30 13:18:20 +00:00
NamedPattern ::Named ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
NamedPattern ::Anonymous ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
2021-06-29 14:54:29 +00:00
}
}
}
2021-07-02 05:48:52 +00:00
fn _any_parse_named_pattern_named ( value : & _Any ) -> std ::result ::Result < NamedPattern , _support ::ParseError > {
let _tmp0 = Binding ::try_from ( value . clone ( ) ) ? ;
Ok ( NamedPattern ::Named ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
fn _any_parse_named_pattern_anonymous ( value : & _Any ) -> std ::result ::Result < NamedPattern , _support ::ParseError > {
let _tmp0 = Pattern ::try_from ( value . clone ( ) ) ? ;
Ok ( NamedPattern ::Anonymous ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
impl std ::convert ::TryFrom < _Any > for NamedPattern {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_named_pattern_named ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_named_pattern_anonymous ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & NamedPattern > for _Any {
fn from ( value : & NamedPattern ) -> Self {
match value {
NamedPattern ::Named ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
NamedPattern ::Anonymous ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
}
}
}
fn _io_parse_named_simple_pattern_named ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < NamedSimplePattern , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = Binding ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( NamedSimplePattern ::Named ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_named_simple_pattern_anonymous ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < NamedSimplePattern , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = SimplePattern ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( NamedSimplePattern ::Anonymous ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for NamedSimplePattern {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_named_simple_pattern_named ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_named_simple_pattern_anonymous ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & NamedSimplePattern > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & NamedSimplePattern ) -> Self {
match value {
2021-06-30 13:18:20 +00:00
NamedSimplePattern ::Named ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
NamedSimplePattern ::Anonymous ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
2021-06-29 14:54:29 +00:00
}
}
}
2021-07-02 05:48:52 +00:00
fn _any_parse_named_simple_pattern_named ( value : & _Any ) -> std ::result ::Result < NamedSimplePattern , _support ::ParseError > {
let _tmp0 = Binding ::try_from ( value . clone ( ) ) ? ;
Ok ( NamedSimplePattern ::Named ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
fn _any_parse_named_simple_pattern_anonymous ( value : & _Any ) -> std ::result ::Result < NamedSimplePattern , _support ::ParseError > {
let _tmp0 = SimplePattern ::try_from ( value . clone ( ) ) ? ;
Ok ( NamedSimplePattern ::Anonymous ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
impl std ::convert ::TryFrom < _Any > for NamedSimplePattern {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_named_simple_pattern_named ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_named_simple_pattern_anonymous ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & NamedSimplePattern > for _Any {
fn from ( value : & NamedSimplePattern ) -> Self {
match value {
NamedSimplePattern ::Named ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
NamedSimplePattern ::Anonymous ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
}
}
}
fn _io_parse_pattern_simple_pattern ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < Pattern , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = SimplePattern ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( Pattern ::SimplePattern ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-07-02 05:48:52 +00:00
fn _io_parse_pattern_compound_pattern ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < Pattern , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = CompoundPattern ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( Pattern ::CompoundPattern ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Pattern {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_pattern_simple_pattern ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_pattern_compound_pattern ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Pattern > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Pattern ) -> Self {
match value {
2021-06-30 13:18:20 +00:00
Pattern ::SimplePattern ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
Pattern ::CompoundPattern ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
2021-06-29 14:54:29 +00:00
}
}
}
2021-07-02 05:48:52 +00:00
fn _any_parse_pattern_simple_pattern ( value : & _Any ) -> std ::result ::Result < Pattern , _support ::ParseError > {
let _tmp0 = SimplePattern ::try_from ( value . clone ( ) ) ? ;
Ok ( Pattern ::SimplePattern ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
fn _any_parse_pattern_compound_pattern ( value : & _Any ) -> std ::result ::Result < Pattern , _support ::ParseError > {
let _tmp0 = CompoundPattern ::try_from ( value . clone ( ) ) ? ;
Ok ( Pattern ::CompoundPattern ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
impl std ::convert ::TryFrom < _Any > for Pattern {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_pattern_simple_pattern ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_pattern_compound_pattern ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & Pattern > for _Any {
fn from ( value : & Pattern ) -> Self {
match value {
Pattern ::SimplePattern ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
Pattern ::CompoundPattern ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
}
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Ref {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_16_REF { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = ModulePath ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
2021-06-30 13:50:50 +00:00
let _tmp3 = ( & _tmp0 . fields ( ) [ 1 ] ) . value ( ) . to_symbol ( ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( Ref { module : _tmp2 , name : _tmp3 . clone ( ) } )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Ref > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Ref ) -> Self {
let Ref { module : _tmp0 , name : _tmp1 } = value ;
{
2021-07-02 05:48:52 +00:00
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_16_REF ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 ) ) ;
2021-06-29 14:54:29 +00:00
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::Value ::symbol ( _tmp1 ) . wrap ( ) ) ;
_tmp2 . finish ( ) . wrap ( )
}
}
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::TryFrom < _Any > for Ref {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_16_REF { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ModulePath ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
let _tmp3 = ( & _tmp0 . fields ( ) [ 1 ] ) . value ( ) . to_symbol ( ) ? ;
Ok ( Ref { module : _tmp2 , name : _tmp3 . clone ( ) } )
}
}
impl std ::convert ::From < & Ref > for _Any {
fn from ( value : & Ref ) -> Self {
let Ref { module : _tmp0 , name : _tmp1 } = value ;
{
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_16_REF ) . clone ( ) ] ) ;
_tmp2 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 ) ) ;
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::Value ::symbol ( _tmp1 ) . wrap ( ) ) ;
_tmp2 . finish ( ) . wrap ( )
}
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Schema {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_17_SCHEMA { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_dictionary ( ) ? ;
2021-07-02 05:48:52 +00:00
let _tmp3 = _tmp2 . get ( & * _io_ ::LIT_18_DEFINITIONS ) . ok_or ( _support ::ParseError ::ConformanceError ) ? ;
2021-06-30 07:53:32 +00:00
let _tmp4 = Definitions ::try_from ( _tmp3 . clone ( ) ) ? ;
2021-07-02 05:48:52 +00:00
let _tmp5 = _tmp2 . get ( & * _io_ ::LIT_19_EMBEDDED_TYPE ) . ok_or ( _support ::ParseError ::ConformanceError ) ? ;
2021-06-30 07:53:32 +00:00
let _tmp6 = EmbeddedTypeName ::try_from ( _tmp5 . clone ( ) ) ? ;
2021-07-02 05:48:52 +00:00
let _tmp7 = _tmp2 . get ( & * _io_ ::LIT_20_VERSION ) . ok_or ( _support ::ParseError ::ConformanceError ) ? ;
2021-06-30 07:53:32 +00:00
let _tmp8 = Version ::try_from ( _tmp7 . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( Schema { definitions : _tmp4 , embedded_type : _tmp6 , version : _tmp8 } )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & Schema > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & Schema ) -> Self {
let Schema { definitions : _tmp0 , embedded_type : _tmp1 , version : _tmp2 } = value ;
{
2021-07-02 05:48:52 +00:00
let mut _tmp3 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_17_SCHEMA ) . clone ( ) ] ) ;
_tmp3 . fields_vec_mut ( ) . push (
{
let mut _tmp4 = preserves ::value ::Map ::new ( ) ;
_tmp4 . insert ( ( & * _io_ ::LIT_18_DEFINITIONS ) . clone ( ) , preserves ::value ::IOValue ::from ( _tmp0 ) ) ;
_tmp4 . insert ( ( & * _io_ ::LIT_19_EMBEDDED_TYPE ) . clone ( ) , preserves ::value ::IOValue ::from ( _tmp1 ) ) ;
_tmp4 . insert ( ( & * _io_ ::LIT_20_VERSION ) . clone ( ) , preserves ::value ::IOValue ::from ( _tmp2 ) ) ;
preserves ::value ::Value ::Dictionary ( _tmp4 ) . wrap ( )
}
) ;
_tmp3 . finish ( ) . wrap ( )
}
}
}
impl std ::convert ::TryFrom < _Any > for Schema {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_17_SCHEMA { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) . value ( ) . to_dictionary ( ) ? ;
let _tmp3 = _tmp2 . get ( & * _any_ ::LIT_18_DEFINITIONS ) . ok_or ( _support ::ParseError ::ConformanceError ) ? ;
let _tmp4 = Definitions ::try_from ( _tmp3 . clone ( ) ) ? ;
let _tmp5 = _tmp2 . get ( & * _any_ ::LIT_19_EMBEDDED_TYPE ) . ok_or ( _support ::ParseError ::ConformanceError ) ? ;
let _tmp6 = EmbeddedTypeName ::try_from ( _tmp5 . clone ( ) ) ? ;
let _tmp7 = _tmp2 . get ( & * _any_ ::LIT_20_VERSION ) . ok_or ( _support ::ParseError ::ConformanceError ) ? ;
let _tmp8 = Version ::try_from ( _tmp7 . clone ( ) ) ? ;
Ok ( Schema { definitions : _tmp4 , embedded_type : _tmp6 , version : _tmp8 } )
}
}
impl std ::convert ::From < & Schema > for _Any {
fn from ( value : & Schema ) -> Self {
let Schema { definitions : _tmp0 , embedded_type : _tmp1 , version : _tmp2 } = value ;
{
let mut _tmp3 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_17_SCHEMA ) . clone ( ) ] ) ;
2021-06-29 14:54:29 +00:00
_tmp3 . fields_vec_mut ( ) . push (
{
let mut _tmp4 = preserves ::value ::Map ::new ( ) ;
2021-07-02 05:48:52 +00:00
_tmp4 . insert ( ( & * _any_ ::LIT_18_DEFINITIONS ) . clone ( ) , _Any ::from ( _tmp0 ) ) ;
_tmp4 . insert ( ( & * _any_ ::LIT_19_EMBEDDED_TYPE ) . clone ( ) , _Any ::from ( _tmp1 ) ) ;
_tmp4 . insert ( ( & * _any_ ::LIT_20_VERSION ) . clone ( ) , _Any ::from ( _tmp2 ) ) ;
2021-06-29 14:54:29 +00:00
preserves ::value ::Value ::Dictionary ( _tmp4 ) . wrap ( )
}
) ;
_tmp3 . finish ( ) . wrap ( )
}
}
}
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_any ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
if value ! = & * _io_ ::LIT_21_ANY { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 13:50:50 +00:00
let _tmp0 = ( ) ;
Ok ( SimplePattern ::Any )
}
2021-06-28 14:35:45 +00:00
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_atom ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_22_ATOM { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = AtomKind ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( SimplePattern ::Atom { atom_kind : std ::boxed ::Box ::new ( _tmp2 ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_embedded ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_23_EMBEDDED { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( SimplePattern ::Embedded { interface : std ::boxed ::Box ::new ( _tmp2 ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_lit ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_24_LIT { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = _Any ::from_io_value ( ( & _tmp0 . fields ( ) [ 0 ] ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( SimplePattern ::Lit { value : _tmp2 . clone ( ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_seqof ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_25_SEQOF { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( SimplePattern ::Seqof { pattern : std ::boxed ::Box ::new ( _tmp2 ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_setof ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_26_SETOF { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( SimplePattern ::Setof { pattern : std ::boxed ::Box ::new ( _tmp2 ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_dictof ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
2021-06-30 13:50:50 +00:00
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
2021-07-02 05:48:52 +00:00
if _tmp0 . label ( ) ! = & * _io_ ::LIT_27_DICTOF { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-28 20:25:41 +00:00
let _tmp1 = ( ) ;
2021-06-30 13:50:50 +00:00
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
let _tmp3 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
2021-06-28 20:25:41 +00:00
Ok ( SimplePattern ::Dictof { key : std ::boxed ::Box ::new ( _tmp2 ) , value : std ::boxed ::Box ::new ( _tmp3 ) } )
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
fn _io_parse_simple_pattern_ref ( value : & preserves ::value ::IOValue ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
2021-06-30 07:53:32 +00:00
let _tmp0 = Ref ::try_from ( value . clone ( ) ) ? ;
2021-06-28 14:35:45 +00:00
Ok ( SimplePattern ::Ref ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for SimplePattern {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if let Ok ( r ) = _io_parse_simple_pattern_any ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_simple_pattern_atom ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_simple_pattern_embedded ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_simple_pattern_lit ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_simple_pattern_seqof ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_simple_pattern_setof ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_simple_pattern_dictof ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _io_parse_simple_pattern_ref ( value ) { return Ok ( r ) ; }
2021-06-30 13:50:50 +00:00
Err ( _support ::ParseError ::ConformanceError )
2021-06-28 14:35:45 +00:00
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::From < & SimplePattern > for preserves ::value ::IOValue {
2021-06-29 14:54:29 +00:00
fn from ( value : & SimplePattern ) -> Self {
match value {
2021-07-02 05:48:52 +00:00
SimplePattern ::Any = > ( & * _io_ ::LIT_21_ANY ) . clone ( ) ,
2021-06-29 14:54:29 +00:00
SimplePattern ::Atom { atom_kind : _tmp0 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_22_ATOM ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp1 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Embedded { interface : _tmp0 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_23_EMBEDDED ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp1 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Lit { value : _tmp0 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_24_LIT ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp1 . fields_vec_mut ( ) . push ( _tmp0 . to_io_value ( ) ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Seqof { pattern : _tmp0 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_25_SEQOF ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp1 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Setof { pattern : _tmp0 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_26_SETOF ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp1 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Dictof { key : _tmp0 , value : _tmp1 } = > {
2021-07-02 05:48:52 +00:00
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _io_ ::LIT_27_DICTOF ) . clone ( ) ] ) ;
2021-06-30 13:18:20 +00:00
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp2 . fields_vec_mut ( ) . push ( preserves ::value ::IOValue ::from ( _tmp1 . as_ref ( ) ) ) ;
2021-06-29 14:54:29 +00:00
_tmp2 . finish ( ) . wrap ( )
} ,
2021-06-30 13:18:20 +00:00
SimplePattern ::Ref ( _tmp0 ) = > preserves ::value ::IOValue ::from ( _tmp0 . as_ref ( ) ) ,
2021-06-29 14:54:29 +00:00
}
}
}
2021-07-02 05:48:52 +00:00
fn _any_parse_simple_pattern_any ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
if value ! = & * _any_ ::LIT_21_ANY { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( SimplePattern ::Any )
}
fn _any_parse_simple_pattern_atom ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_22_ATOM { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = AtomKind ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
Ok ( SimplePattern ::Atom { atom_kind : std ::boxed ::Box ::new ( _tmp2 ) } )
}
fn _any_parse_simple_pattern_embedded ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_23_EMBEDDED { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
Ok ( SimplePattern ::Embedded { interface : std ::boxed ::Box ::new ( _tmp2 ) } )
}
fn _any_parse_simple_pattern_lit ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_24_LIT { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = ( & _tmp0 . fields ( ) [ 0 ] ) ;
Ok ( SimplePattern ::Lit { value : _tmp2 . clone ( ) } )
}
fn _any_parse_simple_pattern_seqof ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_25_SEQOF { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
Ok ( SimplePattern ::Seqof { pattern : std ::boxed ::Box ::new ( _tmp2 ) } )
}
fn _any_parse_simple_pattern_setof ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_26_SETOF { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
Ok ( SimplePattern ::Setof { pattern : std ::boxed ::Box ::new ( _tmp2 ) } )
}
fn _any_parse_simple_pattern_dictof ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
let _tmp0 = value . value ( ) . to_record ( None ) ? ;
if _tmp0 . label ( ) ! = & * _any_ ::LIT_27_DICTOF { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp1 = ( ) ;
if _tmp0 . fields ( ) . len ( ) < 2 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp2 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 0 ] ) . clone ( ) ) ? ;
let _tmp3 = SimplePattern ::try_from ( ( & _tmp0 . fields ( ) [ 1 ] ) . clone ( ) ) ? ;
Ok ( SimplePattern ::Dictof { key : std ::boxed ::Box ::new ( _tmp2 ) , value : std ::boxed ::Box ::new ( _tmp3 ) } )
}
fn _any_parse_simple_pattern_ref ( value : & _Any ) -> std ::result ::Result < SimplePattern , _support ::ParseError > {
let _tmp0 = Ref ::try_from ( value . clone ( ) ) ? ;
Ok ( SimplePattern ::Ref ( std ::boxed ::Box ::new ( _tmp0 ) ) )
}
impl std ::convert ::TryFrom < _Any > for SimplePattern {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if let Ok ( r ) = _any_parse_simple_pattern_any ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_simple_pattern_atom ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_simple_pattern_embedded ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_simple_pattern_lit ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_simple_pattern_seqof ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_simple_pattern_setof ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_simple_pattern_dictof ( value ) { return Ok ( r ) ; }
if let Ok ( r ) = _any_parse_simple_pattern_ref ( value ) { return Ok ( r ) ; }
Err ( _support ::ParseError ::ConformanceError )
}
}
impl std ::convert ::From < & SimplePattern > for _Any {
fn from ( value : & SimplePattern ) -> Self {
match value {
SimplePattern ::Any = > ( & * _any_ ::LIT_21_ANY ) . clone ( ) ,
SimplePattern ::Atom { atom_kind : _tmp0 } = > {
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_22_ATOM ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Embedded { interface : _tmp0 } = > {
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_23_EMBEDDED ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Lit { value : _tmp0 } = > {
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_24_LIT ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push ( _tmp0 . clone ( ) ) ;
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Seqof { pattern : _tmp0 } = > {
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_25_SEQOF ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Setof { pattern : _tmp0 } = > {
let mut _tmp1 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_26_SETOF ) . clone ( ) ] ) ;
_tmp1 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp1 . finish ( ) . wrap ( )
} ,
SimplePattern ::Dictof { key : _tmp0 , value : _tmp1 } = > {
let mut _tmp2 = preserves ::value ::Record ( vec! [ ( & * _any_ ::LIT_27_DICTOF ) . clone ( ) ] ) ;
_tmp2 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp0 . as_ref ( ) ) ) ;
_tmp2 . fields_vec_mut ( ) . push ( _Any ::from ( _tmp1 . as_ref ( ) ) ) ;
_tmp2 . finish ( ) . wrap ( )
} ,
SimplePattern ::Ref ( _tmp0 ) = > _Any ::from ( _tmp0 . as_ref ( ) ) ,
}
}
}
2021-06-30 13:18:20 +00:00
impl std ::convert ::TryFrom < preserves ::value ::IOValue > for Version {
2021-06-30 13:50:50 +00:00
type Error = _support ::ParseError ;
2021-06-30 13:18:20 +00:00
fn try_from ( value : preserves ::value ::IOValue ) -> std ::result ::Result < Self , Self ::Error > {
2021-06-30 07:53:32 +00:00
let value = & value ;
2021-07-02 05:48:52 +00:00
if value ! = & * _io_ ::LIT_28_1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
2021-06-30 07:53:32 +00:00
let _tmp0 = ( ) ;
Ok ( Version )
}
2021-06-28 14:35:45 +00:00
}
2021-07-02 05:48:52 +00:00
impl std ::convert ::From < & Version > for preserves ::value ::IOValue {
fn from ( value : & Version ) -> Self { let Version = value ; ( & * _io_ ::LIT_28_1 ) . clone ( ) }
}
impl std ::convert ::TryFrom < _Any > for Version {
type Error = _support ::ParseError ;
fn try_from ( value : _Any ) -> std ::result ::Result < Self , Self ::Error > {
let value = & value ;
if value ! = & * _any_ ::LIT_28_1 { return Err ( _support ::ParseError ::ConformanceError ) ; }
let _tmp0 = ( ) ;
Ok ( Version )
}
}
impl std ::convert ::From < & Version > for _Any {
fn from ( value : & Version ) -> Self { let Version = value ; ( & * _any_ ::LIT_28_1 ) . clone ( ) }
}
2021-06-29 14:54:29 +00:00