|
|
@ -126,7 +126,7 @@ fn parse_atom_kind_boolean<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_0_BOOLEAN { return Err(_support::ParseError::conformance_error("schema.AtomKind::Boolean")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_0_BOOLEAN { return Err(_support::ParseError::conformance_error("schema.AtomKind::Boolean")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(AtomKind::Boolean)
|
|
|
|
Ok(AtomKind::Boolean)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -136,7 +136,7 @@ fn parse_atom_kind_float<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_1_FLOAT { return Err(_support::ParseError::conformance_error("schema.AtomKind::Float")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_1_FLOAT { return Err(_support::ParseError::conformance_error("schema.AtomKind::Float")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(AtomKind::Float)
|
|
|
|
Ok(AtomKind::Float)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -146,7 +146,7 @@ fn parse_atom_kind_double<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_2_DOUBLE { return Err(_support::ParseError::conformance_error("schema.AtomKind::Double")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_2_DOUBLE { return Err(_support::ParseError::conformance_error("schema.AtomKind::Double")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(AtomKind::Double)
|
|
|
|
Ok(AtomKind::Double)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -156,7 +156,7 @@ fn parse_atom_kind_signed_integer<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_3_SIGNED_INTEGER { return Err(_support::ParseError::conformance_error("schema.AtomKind::SignedInteger")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_3_SIGNED_INTEGER { return Err(_support::ParseError::conformance_error("schema.AtomKind::SignedInteger")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(AtomKind::SignedInteger)
|
|
|
|
Ok(AtomKind::SignedInteger)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -166,7 +166,7 @@ fn parse_atom_kind_string<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_4_STRING { return Err(_support::ParseError::conformance_error("schema.AtomKind::String")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_4_STRING { return Err(_support::ParseError::conformance_error("schema.AtomKind::String")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(AtomKind::String)
|
|
|
|
Ok(AtomKind::String)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -176,7 +176,7 @@ fn parse_atom_kind_byte_string<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_5_BYTE_STRING { return Err(_support::ParseError::conformance_error("schema.AtomKind::ByteString")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_5_BYTE_STRING { return Err(_support::ParseError::conformance_error("schema.AtomKind::ByteString")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(AtomKind::ByteString)
|
|
|
|
Ok(AtomKind::ByteString)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -186,7 +186,7 @@ fn parse_atom_kind_symbol<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<AtomKind, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_6_SYMBOL { return Err(_support::ParseError::conformance_error("schema.AtomKind::Symbol")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_6_SYMBOL { return Err(_support::ParseError::conformance_error("schema.AtomKind::Symbol")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(AtomKind::Symbol)
|
|
|
|
Ok(AtomKind::Symbol)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -215,13 +215,15 @@ impl<
|
|
|
|
> _support::Unparse<_L, _Value> for AtomKind {
|
|
|
|
> _support::Unparse<_L, _Value> for AtomKind {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
match self {
|
|
|
|
match self {
|
|
|
|
AtomKind::Boolean => (&_ctxt.into().LIT_0_BOOLEAN).clone(),
|
|
|
|
AtomKind::Boolean => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_0_BOOLEAN).clone(),
|
|
|
|
AtomKind::Float => (&_ctxt.into().LIT_1_FLOAT).clone(),
|
|
|
|
AtomKind::Float => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_1_FLOAT).clone(),
|
|
|
|
AtomKind::Double => (&_ctxt.into().LIT_2_DOUBLE).clone(),
|
|
|
|
AtomKind::Double => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_2_DOUBLE).clone(),
|
|
|
|
AtomKind::SignedInteger => (&_ctxt.into().LIT_3_SIGNED_INTEGER).clone(),
|
|
|
|
AtomKind::SignedInteger => (
|
|
|
|
AtomKind::String => (&_ctxt.into().LIT_4_STRING).clone(),
|
|
|
|
&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_3_SIGNED_INTEGER
|
|
|
|
AtomKind::ByteString => (&_ctxt.into().LIT_5_BYTE_STRING).clone(),
|
|
|
|
).clone(),
|
|
|
|
AtomKind::Symbol => (&_ctxt.into().LIT_6_SYMBOL).clone(),
|
|
|
|
AtomKind::String => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_4_STRING).clone(),
|
|
|
|
|
|
|
|
AtomKind::ByteString => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_5_BYTE_STRING).clone(),
|
|
|
|
|
|
|
|
AtomKind::Symbol => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_6_SYMBOL).clone(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -266,7 +268,7 @@ impl<
|
|
|
|
> _support::Parse<_L, _Value> for Binding<_Value> {
|
|
|
|
> _support::Parse<_L, _Value> for Binding<_Value> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_7_NAMED { return Err(_support::ParseError::conformance_error("schema.Binding")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_7_NAMED { return Err(_support::ParseError::conformance_error("schema.Binding")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.Binding")); }
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.Binding")); }
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_symbol()?;
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_symbol()?;
|
|
|
@ -283,7 +285,7 @@ impl<
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
let Binding {name: _tmp0, pattern: _tmp1} = self;
|
|
|
|
let Binding {name: _tmp0, pattern: _tmp1} = self;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&_ctxt.into().LIT_7_NAMED).clone()]);
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_7_NAMED).clone()]);
|
|
|
|
_tmp2.fields_vec_mut().push(preserves::value::Value::symbol(_tmp0).wrap());
|
|
|
|
_tmp2.fields_vec_mut().push(preserves::value::Value::symbol(_tmp0).wrap());
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp1.unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp1.unparse(_ctxt));
|
|
|
|
_tmp2.finish().wrap()
|
|
|
|
_tmp2.finish().wrap()
|
|
|
@ -327,7 +329,7 @@ impl<
|
|
|
|
> _support::Parse<_L, _Value> for Bundle<_Value> {
|
|
|
|
> _support::Parse<_L, _Value> for Bundle<_Value> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_8_BUNDLE { return Err(_support::ParseError::conformance_error("schema.Bundle")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_8_BUNDLE { return Err(_support::ParseError::conformance_error("schema.Bundle")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Bundle")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Bundle")); }
|
|
|
|
let _tmp2 = Modules::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = Modules::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -343,7 +345,7 @@ impl<
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
let Bundle {modules: _tmp0} = self;
|
|
|
|
let Bundle {modules: _tmp0} = self;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_8_BUNDLE).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_8_BUNDLE).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.unparse(_ctxt));
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.unparse(_ctxt));
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -491,7 +493,7 @@ fn parse_compound_pattern_rec<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_9_REC { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::rec")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_9_REC { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::rec")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::rec")); }
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::rec")); }
|
|
|
|
let _tmp2 = NamedPattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = NamedPattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -505,7 +507,7 @@ fn parse_compound_pattern_tuple<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_10_TUPLE { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuple")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_10_TUPLE { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuple")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuple")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuple")); }
|
|
|
|
let _tmp3 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
|
let _tmp3 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
@ -523,7 +525,7 @@ fn parse_compound_pattern_tuple_prefix<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_11_TUPLE_PREFIX { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuplePrefix")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_11_TUPLE_PREFIX { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuplePrefix")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuplePrefix")); }
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::tuplePrefix")); }
|
|
|
|
let _tmp3 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
|
let _tmp3 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
@ -542,7 +544,7 @@ fn parse_compound_pattern_dict<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<CompoundPattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_12_DICT { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::dict")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_12_DICT { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::dict")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::dict")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.CompoundPattern::dict")); }
|
|
|
|
let _tmp2 = DictionaryEntries::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = DictionaryEntries::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -571,13 +573,13 @@ impl<
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
match self {
|
|
|
|
match self {
|
|
|
|
CompoundPattern::Rec {label: _tmp0, fields: _tmp1} => {
|
|
|
|
CompoundPattern::Rec {label: _tmp0, fields: _tmp1} => {
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&_ctxt.into().LIT_9_REC).clone()]);
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_9_REC).clone()]);
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp1.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp1.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.finish().wrap()
|
|
|
|
_tmp2.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
CompoundPattern::Tuple {patterns: _tmp0} => {
|
|
|
|
CompoundPattern::Tuple {patterns: _tmp0} => {
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_10_TUPLE).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_10_TUPLE).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(
|
|
|
|
_tmp1.fields_vec_mut().push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp2 = std::vec::Vec::new();
|
|
|
|
let mut _tmp2 = std::vec::Vec::new();
|
|
|
@ -590,7 +592,9 @@ impl<
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
CompoundPattern::TuplePrefix {fixed: _tmp0, variable: _tmp1} => {
|
|
|
|
CompoundPattern::TuplePrefix {fixed: _tmp0, variable: _tmp1} => {
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&_ctxt.into().LIT_11_TUPLE_PREFIX).clone()]);
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(
|
|
|
|
|
|
|
|
&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_11_TUPLE_PREFIX
|
|
|
|
|
|
|
|
).clone()]);
|
|
|
|
_tmp2.fields_vec_mut().push(
|
|
|
|
_tmp2.fields_vec_mut().push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp3 = std::vec::Vec::new();
|
|
|
|
let mut _tmp3 = std::vec::Vec::new();
|
|
|
@ -604,7 +608,7 @@ impl<
|
|
|
|
_tmp2.finish().wrap()
|
|
|
|
_tmp2.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
CompoundPattern::Dict {entries: _tmp0} => {
|
|
|
|
CompoundPattern::Dict {entries: _tmp0} => {
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_12_DICT).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_12_DICT).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -728,7 +732,7 @@ fn parse_definition_or<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<Definition<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<Definition<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_13_OR { return Err(_support::ParseError::conformance_error("schema.Definition::or")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_13_OR { return Err(_support::ParseError::conformance_error("schema.Definition::or")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Definition::or")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Definition::or")); }
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
@ -753,7 +757,7 @@ fn parse_definition_and<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<Definition<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<Definition<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_14_AND { return Err(_support::ParseError::conformance_error("schema.Definition::and")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_14_AND { return Err(_support::ParseError::conformance_error("schema.Definition::and")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Definition::and")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Definition::and")); }
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_sequence()?;
|
|
|
@ -802,7 +806,7 @@ impl<
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
match self {
|
|
|
|
match self {
|
|
|
|
Definition::Or {pattern_0: _tmp0, pattern_1: _tmp1, pattern_n: _tmp2} => {
|
|
|
|
Definition::Or {pattern_0: _tmp0, pattern_1: _tmp1, pattern_n: _tmp2} => {
|
|
|
|
let mut _tmp3 = preserves::value::Record(vec![(&_ctxt.into().LIT_13_OR).clone()]);
|
|
|
|
let mut _tmp3 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_13_OR).clone()]);
|
|
|
|
_tmp3.fields_vec_mut().push(
|
|
|
|
_tmp3.fields_vec_mut().push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp4 = std::vec::Vec::new();
|
|
|
|
let mut _tmp4 = std::vec::Vec::new();
|
|
|
@ -817,7 +821,7 @@ impl<
|
|
|
|
_tmp3.finish().wrap()
|
|
|
|
_tmp3.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Definition::And {pattern_0: _tmp0, pattern_1: _tmp1, pattern_n: _tmp2} => {
|
|
|
|
Definition::And {pattern_0: _tmp0, pattern_1: _tmp1, pattern_n: _tmp2} => {
|
|
|
|
let mut _tmp3 = preserves::value::Record(vec![(&_ctxt.into().LIT_14_AND).clone()]);
|
|
|
|
let mut _tmp3 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_14_AND).clone()]);
|
|
|
|
_tmp3.fields_vec_mut().push(
|
|
|
|
_tmp3.fields_vec_mut().push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp4 = std::vec::Vec::new();
|
|
|
|
let mut _tmp4 = std::vec::Vec::new();
|
|
|
@ -986,7 +990,7 @@ fn parse_embedded_type_name_false<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<EmbeddedTypeName, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<EmbeddedTypeName, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_15_FALSE { return Err(_support::ParseError::conformance_error("schema.EmbeddedTypeName::false")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_15_FALSE { return Err(_support::ParseError::conformance_error("schema.EmbeddedTypeName::false")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(EmbeddedTypeName::False)
|
|
|
|
Ok(EmbeddedTypeName::False)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1011,7 +1015,7 @@ impl<
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
match self {
|
|
|
|
match self {
|
|
|
|
EmbeddedTypeName::Ref(_tmp0) => _tmp0.as_ref().unparse(_ctxt),
|
|
|
|
EmbeddedTypeName::Ref(_tmp0) => _tmp0.as_ref().unparse(_ctxt),
|
|
|
|
EmbeddedTypeName::False => (&_ctxt.into().LIT_15_FALSE).clone(),
|
|
|
|
EmbeddedTypeName::False => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_15_FALSE).clone(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1424,7 +1428,7 @@ impl<
|
|
|
|
> _support::Parse<_L, _Value> for Ref {
|
|
|
|
> _support::Parse<_L, _Value> for Ref {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_16_REF { return Err(_support::ParseError::conformance_error("schema.Ref")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_16_REF { return Err(_support::ParseError::conformance_error("schema.Ref")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.Ref")); }
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.Ref")); }
|
|
|
|
let _tmp2 = ModulePath::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = ModulePath::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -1441,7 +1445,7 @@ impl<
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
let Ref {module: _tmp0, name: _tmp1} = self;
|
|
|
|
let Ref {module: _tmp0, name: _tmp1} = self;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&_ctxt.into().LIT_16_REF).clone()]);
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_16_REF).clone()]);
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp0.unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp0.unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(preserves::value::Value::symbol(_tmp1).wrap());
|
|
|
|
_tmp2.fields_vec_mut().push(preserves::value::Value::symbol(_tmp1).wrap());
|
|
|
|
_tmp2.finish().wrap()
|
|
|
|
_tmp2.finish().wrap()
|
|
|
@ -1523,15 +1527,19 @@ impl<
|
|
|
|
> _support::Parse<_L, _Value> for Schema<_Value> {
|
|
|
|
> _support::Parse<_L, _Value> for Schema<_Value> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_17_SCHEMA { return Err(_support::ParseError::conformance_error("schema.Schema")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_17_SCHEMA { return Err(_support::ParseError::conformance_error("schema.Schema")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Schema")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.Schema")); }
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_dictionary()?;
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]).value().to_dictionary()?;
|
|
|
|
let _tmp3 = _tmp2.get(&_ctxt.into().LIT_18_DEFINITIONS).ok_or_else(|| _support::ParseError::conformance_error("schema.Schema"))?;
|
|
|
|
let _tmp3 = _tmp2.get(
|
|
|
|
|
|
|
|
&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_18_DEFINITIONS
|
|
|
|
|
|
|
|
).ok_or_else(|| _support::ParseError::conformance_error("schema.Schema"))?;
|
|
|
|
let _tmp4 = Definitions::parse(_ctxt, _tmp3)?;
|
|
|
|
let _tmp4 = Definitions::parse(_ctxt, _tmp3)?;
|
|
|
|
let _tmp5 = _tmp2.get(&_ctxt.into().LIT_19_EMBEDDED_TYPE).ok_or_else(|| _support::ParseError::conformance_error("schema.Schema"))?;
|
|
|
|
let _tmp5 = _tmp2.get(
|
|
|
|
|
|
|
|
&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_19_EMBEDDED_TYPE
|
|
|
|
|
|
|
|
).ok_or_else(|| _support::ParseError::conformance_error("schema.Schema"))?;
|
|
|
|
let _tmp6 = EmbeddedTypeName::parse(_ctxt, _tmp5)?;
|
|
|
|
let _tmp6 = EmbeddedTypeName::parse(_ctxt, _tmp5)?;
|
|
|
|
let _tmp7 = _tmp2.get(&_ctxt.into().LIT_20_VERSION).ok_or_else(|| _support::ParseError::conformance_error("schema.Schema"))?;
|
|
|
|
let _tmp7 = _tmp2.get(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_20_VERSION).ok_or_else(|| _support::ParseError::conformance_error("schema.Schema"))?;
|
|
|
|
let _tmp8 = Version::parse(_ctxt, _tmp7)?;
|
|
|
|
let _tmp8 = Version::parse(_ctxt, _tmp7)?;
|
|
|
|
Ok(Schema {definitions: _tmp4, embedded_type: _tmp6, version: _tmp8})
|
|
|
|
Ok(Schema {definitions: _tmp4, embedded_type: _tmp6, version: _tmp8})
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1545,13 +1553,26 @@ impl<
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
let Schema {definitions: _tmp0, embedded_type: _tmp1, version: _tmp2} = self;
|
|
|
|
let Schema {definitions: _tmp0, embedded_type: _tmp1, version: _tmp2} = self;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp3 = preserves::value::Record(vec![(&_ctxt.into().LIT_17_SCHEMA).clone()]);
|
|
|
|
let mut _tmp3 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_17_SCHEMA).clone()]);
|
|
|
|
_tmp3.fields_vec_mut().push(
|
|
|
|
_tmp3.fields_vec_mut().push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut _tmp4 = preserves::value::Map::new();
|
|
|
|
let mut _tmp4 = preserves::value::Map::new();
|
|
|
|
_tmp4.insert((&_ctxt.into().LIT_18_DEFINITIONS).clone(), _tmp0.unparse(_ctxt));
|
|
|
|
_tmp4.insert(
|
|
|
|
_tmp4.insert((&_ctxt.into().LIT_19_EMBEDDED_TYPE).clone(), _tmp1.unparse(_ctxt));
|
|
|
|
(
|
|
|
|
_tmp4.insert((&_ctxt.into().LIT_20_VERSION).clone(), _tmp2.unparse(_ctxt));
|
|
|
|
&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_18_DEFINITIONS
|
|
|
|
|
|
|
|
).clone(),
|
|
|
|
|
|
|
|
_tmp0.unparse(_ctxt)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
_tmp4.insert(
|
|
|
|
|
|
|
|
(
|
|
|
|
|
|
|
|
&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_19_EMBEDDED_TYPE
|
|
|
|
|
|
|
|
).clone(),
|
|
|
|
|
|
|
|
_tmp1.unparse(_ctxt)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
_tmp4.insert(
|
|
|
|
|
|
|
|
(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_20_VERSION).clone(),
|
|
|
|
|
|
|
|
_tmp2.unparse(_ctxt)
|
|
|
|
|
|
|
|
);
|
|
|
|
preserves::value::Value::Dictionary(_tmp4).wrap()
|
|
|
|
preserves::value::Value::Dictionary(_tmp4).wrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -1747,7 +1768,7 @@ fn parse_simple_pattern_any<
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_L: Copy + Into<&'a crate::gen::Language<_Value>>,
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_21_ANY { return Err(_support::ParseError::conformance_error("schema.SimplePattern::any")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_21_ANY { return Err(_support::ParseError::conformance_error("schema.SimplePattern::any")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(SimplePattern::Any)
|
|
|
|
Ok(SimplePattern::Any)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1758,7 +1779,7 @@ fn parse_simple_pattern_atom<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_22_ATOM { return Err(_support::ParseError::conformance_error("schema.SimplePattern::atom")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_22_ATOM { return Err(_support::ParseError::conformance_error("schema.SimplePattern::atom")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::atom")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::atom")); }
|
|
|
|
let _tmp2 = AtomKind::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = AtomKind::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -1771,7 +1792,7 @@ fn parse_simple_pattern_embedded<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_23_EMBEDDED { return Err(_support::ParseError::conformance_error("schema.SimplePattern::embedded")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_23_EMBEDDED { return Err(_support::ParseError::conformance_error("schema.SimplePattern::embedded")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::embedded")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::embedded")); }
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -1784,7 +1805,7 @@ fn parse_simple_pattern_lit<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_24_LIT { return Err(_support::ParseError::conformance_error("schema.SimplePattern::lit")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_24_LIT { return Err(_support::ParseError::conformance_error("schema.SimplePattern::lit")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::lit")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::lit")); }
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]);
|
|
|
|
let _tmp2 = (&_tmp0.fields()[0]);
|
|
|
@ -1797,7 +1818,7 @@ fn parse_simple_pattern_seqof<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_25_SEQOF { return Err(_support::ParseError::conformance_error("schema.SimplePattern::seqof")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_25_SEQOF { return Err(_support::ParseError::conformance_error("schema.SimplePattern::seqof")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::seqof")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::seqof")); }
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -1810,7 +1831,7 @@ fn parse_simple_pattern_setof<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_26_SETOF { return Err(_support::ParseError::conformance_error("schema.SimplePattern::setof")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_26_SETOF { return Err(_support::ParseError::conformance_error("schema.SimplePattern::setof")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::setof")); }
|
|
|
|
if _tmp0.fields().len() < 1 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::setof")); }
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -1823,7 +1844,7 @@ fn parse_simple_pattern_dictof<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
>(_ctxt: _L, value: &_Value) -> std::result::Result<SimplePattern<_Value>, _support::ParseError> {
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
let _tmp0 = value.value().to_record(None)?;
|
|
|
|
if _tmp0.label() != &_ctxt.into().LIT_27_DICTOF { return Err(_support::ParseError::conformance_error("schema.SimplePattern::dictof")); }
|
|
|
|
if _tmp0.label() != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_27_DICTOF { return Err(_support::ParseError::conformance_error("schema.SimplePattern::dictof")); }
|
|
|
|
let _tmp1 = ();
|
|
|
|
let _tmp1 = ();
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::dictof")); }
|
|
|
|
if _tmp0.fields().len() < 2 { return Err(_support::ParseError::conformance_error("schema.SimplePattern::dictof")); }
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
|
let _tmp2 = SimplePattern::parse(_ctxt, (&_tmp0.fields()[0]))?;
|
|
|
@ -1865,34 +1886,34 @@ impl<
|
|
|
|
> _support::Unparse<_L, _Value> for SimplePattern<_Value> {
|
|
|
|
> _support::Unparse<_L, _Value> for SimplePattern<_Value> {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
match self {
|
|
|
|
match self {
|
|
|
|
SimplePattern::Any => (&_ctxt.into().LIT_21_ANY).clone(),
|
|
|
|
SimplePattern::Any => (&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_21_ANY).clone(),
|
|
|
|
SimplePattern::Atom {atom_kind: _tmp0} => {
|
|
|
|
SimplePattern::Atom {atom_kind: _tmp0} => {
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_22_ATOM).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_22_ATOM).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SimplePattern::Embedded {interface: _tmp0} => {
|
|
|
|
SimplePattern::Embedded {interface: _tmp0} => {
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_23_EMBEDDED).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_23_EMBEDDED).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SimplePattern::Lit {value: _tmp0} => {
|
|
|
|
SimplePattern::Lit {value: _tmp0} => {
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_24_LIT).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_24_LIT).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.clone());
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.clone());
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SimplePattern::Seqof {pattern: _tmp0} => {
|
|
|
|
SimplePattern::Seqof {pattern: _tmp0} => {
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_25_SEQOF).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_25_SEQOF).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SimplePattern::Setof {pattern: _tmp0} => {
|
|
|
|
SimplePattern::Setof {pattern: _tmp0} => {
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&_ctxt.into().LIT_26_SETOF).clone()]);
|
|
|
|
let mut _tmp1 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_26_SETOF).clone()]);
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
_tmp1.finish().wrap()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SimplePattern::Dictof {key: _tmp0, value: _tmp1} => {
|
|
|
|
SimplePattern::Dictof {key: _tmp0, value: _tmp1} => {
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&_ctxt.into().LIT_27_DICTOF).clone()]);
|
|
|
|
let mut _tmp2 = preserves::value::Record(vec![(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_27_DICTOF).clone()]);
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp0.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp1.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.fields_vec_mut().push(_tmp1.as_ref().unparse(_ctxt));
|
|
|
|
_tmp2.finish().wrap()
|
|
|
|
_tmp2.finish().wrap()
|
|
|
@ -1927,7 +1948,7 @@ impl<
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
_Value: preserves::value::NestedValue + 'a
|
|
|
|
> _support::Parse<_L, _Value> for Version {
|
|
|
|
> _support::Parse<_L, _Value> for Version {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
fn parse(_ctxt: _L, value: &_Value) -> std::result::Result<Self, _support::ParseError> {
|
|
|
|
if value != &_ctxt.into().LIT_28_1 { return Err(_support::ParseError::conformance_error("schema.Version")); }
|
|
|
|
if value != &<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_28_1 { return Err(_support::ParseError::conformance_error("schema.Version")); }
|
|
|
|
let _tmp0 = ();
|
|
|
|
let _tmp0 = ();
|
|
|
|
Ok(Version)
|
|
|
|
Ok(Version)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1940,6 +1961,6 @@ impl<
|
|
|
|
> _support::Unparse<_L, _Value> for Version {
|
|
|
|
> _support::Unparse<_L, _Value> for Version {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
fn unparse(&self, _ctxt: _L) -> _Value {
|
|
|
|
let Version = self;
|
|
|
|
let Version = self;
|
|
|
|
(&_ctxt.into().LIT_28_1).clone()
|
|
|
|
(&<_L as Into<&'a crate::gen::Language<_Value>>>::into(_ctxt).LIT_28_1).clone()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|