Assume :standard-properties is an expected field.
This commit is contained in:
@@ -1,9 +1,3 @@
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum EmacsField<'s> {
|
||||
Required(&'s str),
|
||||
Optional(&'s str),
|
||||
}
|
||||
|
||||
/// Create iterators for ast nodes where it only has to iterate over children
|
||||
macro_rules! compare_properties {
|
||||
($emacs:expr, $($emacs_field:expr, $rust_value:expr, $compare_fn: ident),+) => {
|
||||
@@ -16,7 +10,7 @@ macro_rules! compare_properties {
|
||||
.nth(1)
|
||||
.ok_or("Should have an attributes child.")?;
|
||||
let attributes_map = attributes_child.as_map()?;
|
||||
let mut emacs_keys: BTreeSet<&str> = attributes_map.keys().map(|s| *s).collect();
|
||||
let mut emacs_keys: BTreeSet<&str> = attributes_map.keys().map(|s| *s).filter(|s| *s != ":standard-properties").collect();
|
||||
$(
|
||||
match $emacs_field {
|
||||
EmacsField::Required(name) if emacs_keys.contains(name) => {
|
||||
|
||||
Reference in New Issue
Block a user