Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/tamer
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2022-03-29 11:25:05 -0400
committerMike Gerwitz <mike.gerwitz@ryansg.com>2022-03-29 11:25:05 -0400
commitdf05a715081cdab3a8c031ff8169aff0eaad2762 (patch)
treeb64d5695b0fb10398a04019c98b547dcccea2b20 /tamer
parentf42288f3a2ed14790df58b4028db26113ec1398c (diff)
downloadtame-df05a715081cdab3a8c031ff8169aff0eaad2762.tar.gz
tame-df05a715081cdab3a8c031ff8169aff0eaad2762.tar.bz2
tame-df05a715081cdab3a8c031ff8169aff0eaad2762.zip
tamer: obj::xmlo::reader: Emphasize generic SymtableState stitching for Object
This simply makes the block more generic to emphasize how it can be abstracted away. DEV-10863
Diffstat (limited to 'tamer')
-rw-r--r--tamer/src/obj/xmlo/reader.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/tamer/src/obj/xmlo/reader.rs b/tamer/src/obj/xmlo/reader.rs
index c446227..78d6a2e 100644
--- a/tamer/src/obj/xmlo/reader.rs
+++ b/tamer/src/obj/xmlo/reader.rs
@@ -177,9 +177,8 @@ impl<SS: XmloSymtableState> ParseState for XmloReaderState<SS> {
(Transition(ss), Ok(Incomplete)) => {
Transition(Symtable(span, ss)).incomplete()
}
- (Transition(ss), Ok(Obj((name, attrs, span)))) => {
- Transition(Symtable(span, ss))
- .ok(XmloEvent::SymDecl(name, attrs, span))
+ (Transition(ss), Ok(Obj(obj))) => {
+ Transition(Symtable(span, ss)).ok(Self::Object::from(obj))
}
(Transition(ss), Ok(Dead(tok))) => {
Transition(Symtable(span, ss)).dead(tok)
@@ -275,5 +274,13 @@ impl ParseState for SymtableState {
}
}
+impl From<(SymbolId, SymAttrs, Span)> for XmloEvent {
+ fn from(tup: (SymbolId, SymAttrs, Span)) -> Self {
+ match tup {
+ (sym, attrs, span) => Self::SymDecl(sym, attrs, span)
+ }
+ }
+}
+
#[cfg(test)]
mod test;