tame/tamer/src/xir
Mike Gerwitz 7b6d68af85 tamer: xir::parse::Transition: Generalize flat::Transition
XIRF introduced the concept of `Transition` to help document code and
provide mental synchronization points that make it easier to reason about
the system.  I decided to hoist this into XIR's parser itself, and have
`parse_token` accept an owned state and require a new state to be returned,
utilizing `Transition`.

Together with the convenience methods introduced on `Transition` itself,
this produces much clearer code, as is evidenced by tree::Stack (XIRT's
parser).  Passing an owned state is something that I had wanted to do
originally, but I thought it'd lead to more concise code to use a mutable
reference.  Unfortunately, that concision lead to code that was much more
difficult than necessary to understand, and ended up having a net negative
benefit by leading to some more boilerplate for the nested types (granted,
that could have been alleviated in other ways).

This also opens up the possibility to do something that I wasn't able to
before, which was continue to abstract away parser composition by stitching
their state machines together.  I don't know if this'll be done immediately,
but because the actual parsing operations are now able to compose
functionally without mutability getting the way, the previous state coupling
issues with the parent parser go away.

DEV-10863
2022-03-17 16:02:05 -04:00
..
attr tamer: xir::parse::Transition: Generalize flat::Transition 2022-03-17 16:02:05 -04:00
flat tamer: xir::flat: Initial XIRF implementation 2022-03-17 13:08:16 -04:00
reader tamer: xir::Token::AttrEnd: Remove 2021-12-17 10:14:31 -05:00
tree tamer: xir::parse::Transition: Generalize flat::Transition 2022-03-17 16:02:05 -04:00
attr.rs tamer: xir::parse::Transition: Generalize flat::Transition 2022-03-17 16:02:05 -04:00
error.rs tamer: xir::XirString: WIP implementation (likely going away) 2021-11-10 12:22:10 -05:00
escape.rs tamer: xir::escape::CachingEscaper: allow(dead_code) for feature-flagged code 2022-03-10 10:03:07 -05:00
flat.rs tamer: xir::parse::Transition: Generalize flat::Transition 2022-03-17 16:02:05 -04:00
iter.rs tamer: {ir::=>}{asg, xir} 2021-11-04 16:13:27 -04:00
parse.rs tamer: xir::parse::Transition: Generalize flat::Transition 2022-03-17 16:02:05 -04:00
pred.rs tamer: {ir::=>}{asg, xir} 2021-11-04 16:13:27 -04:00
reader.rs tamer: xir::Token::AttrEnd: Remove 2021-12-17 10:14:31 -05:00
tree.rs tamer: xir::parse::Transition: Generalize flat::Transition 2022-03-17 16:02:05 -04:00
writer.rs tamer: xir::Token::AttrEnd: Remove 2021-12-17 10:14:31 -05:00