Update skeleton

This commit is contained in:
Jeehoon Kang
2020-04-20 16:19:44 +09:00
parent 72ec63ea82
commit 5b45cf1fd8
5 changed files with 34 additions and 5 deletions

View File

@@ -88,11 +88,20 @@ impl IsEquiv for Initializer {
fn is_equiv(&self, other: &Self) -> bool {
match (self, other) {
(Self::Expression(expr), Self::Expression(other_expr)) => expr.is_equiv(other_expr),
(Self::List(items), Self::List(other_items)) => items.is_equiv(other_items),
_ => false,
}
}
}
impl IsEquiv for InitializerListItem {
fn is_equiv(&self, other: &Self) -> bool {
self.designation.is_empty()
&& other.designation.is_empty()
&& self.initializer.is_equiv(&other.initializer)
}
}
impl IsEquiv for Declarator {
fn is_equiv(&self, other: &Self) -> bool {
self.kind.is_equiv(&other.kind) && self.derived.is_equiv(&other.derived)