fix: more subtle things
This commit is contained in:
parent
4c45c95620
commit
60a920a0ac
|
@ -187,7 +187,10 @@ impl TryFrom<u8> for DefaultFunction {
|
|||
v if v == DefaultFunction::MkPairData as u8 => Ok(DefaultFunction::MkPairData),
|
||||
v if v == DefaultFunction::MkNilData as u8 => Ok(DefaultFunction::MkNilData),
|
||||
v if v == DefaultFunction::MkNilPairData as u8 => Ok(DefaultFunction::MkNilPairData),
|
||||
_ => Err(de::Error::Message("Default Function not found".to_string())),
|
||||
_ => Err(de::Error::Message(format!(
|
||||
"Default Function not found - {}",
|
||||
v
|
||||
))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,10 @@ where
|
|||
|
||||
Ok(hex)
|
||||
}
|
||||
|
||||
pub fn from_flat(bytes: &'b [u8]) -> Result<Self, de::Error> {
|
||||
Self::unflat(bytes)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'b, T> Encode for Program<T>
|
||||
|
|
|
@ -65,7 +65,7 @@ where
|
|||
Input::Error: ParseError<Input::Token, Input::Range, Input::Position>,
|
||||
{
|
||||
let prog = string("program").with(skip_many1(space())).with(
|
||||
(version(), skip_many1(space()), term().skip(spaces()))
|
||||
(version(), skip_many1(space()), term())
|
||||
.map(|(version, _, term)| Program { version, term }),
|
||||
);
|
||||
|
||||
|
@ -100,7 +100,8 @@ where
|
|||
Input: Stream<Token = char>,
|
||||
Input::Error: ParseError<Input::Token, Input::Range, Input::Position>,
|
||||
{
|
||||
opaque!(no_partial(choice((
|
||||
opaque!(no_partial(
|
||||
choice((
|
||||
attempt(var()),
|
||||
attempt(delay()),
|
||||
attempt(lambda()),
|
||||
|
@ -109,7 +110,9 @@ where
|
|||
attempt(force()),
|
||||
attempt(error()),
|
||||
attempt(builtin()),
|
||||
))))
|
||||
))
|
||||
.skip(spaces())
|
||||
))
|
||||
}
|
||||
|
||||
fn var<Input>() -> impl Parser<StateStream<Input>, Output = Term<Name>>
|
||||
|
|
Loading…
Reference in New Issue