diff --git a/tx-parser/src/lib.rs b/tx-parser/src/lib.rs index 8b136ba4..87290c08 100644 --- a/tx-parser/src/lib.rs +++ b/tx-parser/src/lib.rs @@ -174,66 +174,15 @@ impl Tx fn_parser(Tx::::retract_, "[:db/retract e a v]") } - fn retract_attribute_(input: I) -> ParseResult { - return satisfy_map(|x: Value| -> Option { - if let Value::Vector(y) = x { - let mut p = (token(Value::NamespacedKeyword(NamespacedKeyword::new("db", "retractAttribute"))), - Tx::<&[Value]>::entid_or_lookup_ref(), - Tx::<&[Value]>::entid(), - eof()) - .map(|(_, e, a, _)| Entity::RetractAttribute { e: e, a: a }); - // TODO: use ok() with a type annotation rather than explicit match. - match p.parse_lazy(&y[..]).into() { - Ok((r, _)) => Some(r), - _ => None, - } - } else { - None - } - }) - .parse_stream(input); - } - - fn retract_attribute() -> TxParser { - fn_parser(Tx::::retract_attribute_, "[:db/retractAttribute e a]") - } - - fn retract_entity_(input: I) -> ParseResult { - return satisfy_map(|x: Value| -> Option { - if let Value::Vector(y) = x { - let mut p = - (token(Value::NamespacedKeyword(NamespacedKeyword::new("db", - "retractEntity"))), - Tx::<&[Value]>::entid_or_lookup_ref(), - eof()) - .map(|(_, e, _)| Entity::RetractEntity { e: e }); - // TODO: use ok() with a type annotation rather than explicit match. - match p.parse_lazy(&y[..]).into() { - Ok((r, _)) => Some(r), - _ => None, - } - } else { - None - } - }) - .parse_stream(input); - } - - fn retract_entity() -> TxParser { - fn_parser(Tx::::retract_entity_, "[:db/retractEntity e]") - } - fn entity_(input: I) -> ParseResult { let mut p = Tx::::add() - .or(Tx::::retract()) - .or(Tx::::retract_attribute()) - .or(Tx::::retract_entity()); + .or(Tx::::retract()); p.parse_stream(input) } fn entity() -> TxParser { fn_parser(Tx::::entity_, - "[:db/add|:db/retract|:db/retractAttribute|:db/retractEntity ...]") + "[:db/add|:db/retract ...]") } fn entities_(input: I) -> ParseResult, I> { @@ -254,7 +203,7 @@ impl Tx fn entities() -> TxParser, I> { fn_parser(Tx::::entities_, - "[[:db/add|:db/retract|:db/retractAttribute|:db/retractEntity ...]*]") + "[[:db/add|:db/retract ...]*]") } pub fn parse(input: I) -> Result, combine::ParseError> { diff --git a/tx/src/entities.rs b/tx/src/entities.rs index fd78d501..2eb411c2 100644 --- a/tx/src/entities.rs +++ b/tx/src/entities.rs @@ -53,6 +53,4 @@ pub enum Entity { a: Entid, v: ValueOrLookupRef, }, - RetractAttribute { e: EntidOrLookupRef, a: Entid }, - RetractEntity { e: EntidOrLookupRef }, }