mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2024-11-05 07:16:23 +01:00
pawarser: require/derive PartialEq
+ Eq
for NodeKind and its contents
This commit is contained in:
parent
91f766c18e
commit
fed8cf2466
|
@ -1,6 +1,6 @@
|
|||
use crate::syntax_kind::SyntaxKind;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub enum SyntaxError {
|
||||
DisallowedKeyType(SyntaxKind),
|
||||
MemberMissingValue,
|
||||
|
|
|
@ -13,7 +13,7 @@ pub mod marker;
|
|||
/// this is used to define some required SyntaxKinds like an EOF token or an error token
|
||||
pub trait SyntaxElement
|
||||
where
|
||||
Self: EnumSetType + Into<rowan::SyntaxKind> + Clone,
|
||||
Self: EnumSetType + Into<rowan::SyntaxKind> + Clone + PartialEq + Eq,
|
||||
{
|
||||
/// EOF value. This will be used by the rest of the parser library to represent an EOF.
|
||||
const EOF: Self;
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// TODO: constrain that conversion to `NodeKind::Error` is enforced to be possible
|
||||
pub trait SyntaxError
|
||||
where
|
||||
Self: Clone,
|
||||
Self: Clone + PartialEq + Eq,
|
||||
{
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ impl<SyntaxKind: SyntaxElement, SyntaxErr: SyntaxError> Event<SyntaxKind, Syntax
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub enum NodeKind<SyntaxKind: SyntaxElement, SyntaxErr: SyntaxError> {
|
||||
Tombstone,
|
||||
Syntax(SyntaxKind),
|
||||
|
|
Loading…
Reference in a new issue