Skip to content

Commit

Permalink
fix(vm): Accept trailing comma in record macros
Browse files Browse the repository at this point in the history
Fixes #770
  • Loading branch information
Marwes committed Aug 5, 2019
1 parent 6848e3c commit f35c0b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/marshalling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ fn marshal_enum() -> Result<()> {
"#;
type SourceType<'thread> = record_type! {
unwrap_b => api::FunctionRef<'thread, fn (Enum) -> i32>,
value => Enum
value => Enum,
};
let (record_p! { mut unwrap_b, value }, _) =
let (record_p! { mut unwrap_b, value, }, _) =
Compiler::new().run_expr::<SourceType>(&thread, "example", source)?;
match value {
Enum::C(ref a, ref b) => {
Expand Down
4 changes: 2 additions & 2 deletions vm/src/api/mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ macro_rules! row_type {
/// ```
#[macro_export(local_inner_macros)]
macro_rules! record_type {
($($field: ident => $value: ty),*) => {
($($field: ident => $value: ty),* $(,)?) => {
$crate::api::Record<
$crate::frunk_core::hlist::HNil,
record_type_inner!($($field => $value),*)
Expand Down Expand Up @@ -438,7 +438,7 @@ macro_rules! record_p_impl {
/// ```
#[macro_export(local_inner_macros)]
macro_rules! record_p {
($($field: pat),*) => {
($($field: pat),* $(,)?) => {
$crate::api::Record {
fields: record_p_impl!($($field),*),
type_fields: _
Expand Down

0 comments on commit f35c0b9

Please sign in to comment.