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-10863main
parent
f42288f3a2
commit
df05a71508
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue