Skip to content

Instantly share code, notes, and snippets.

@conartist6
Last active Mar 22, 2022
Embed
What would you like to do?
@iter-tools/regex data structure
┌───────────────┐
│ Expression │
│ root: true │
│ globalIdx: 1 │
└───────┬───────┘
parentSeq │ ▲
│ │ expr
┌──────────────┐ ┌───────┴─┴─────┐
│ State │ │ State │
│ type: cont │ │ type: success │
└──────────────┘ └───────┬───────┘
▲ │ ▲
│ state ▼ │ state
better ┌────────┴─────┐ better ┌─────────┴─────┐
null ◄──┤ Sequence │◄─────────┤ Sequence │
│ │ worse │ │ worse
└──────┬───────┴─────────►└───────────────┴──► null
parentExpr │ ▲
▼ │ best
┌────────┴─────┐
│ Expression │
│ │
└──────┬───────┘
parentSeq │ ▲
│ │ expr
┌──────────────┐ ┌──────┴─┴─────┐
│ State │ │ State │
│ type: cont │ │ type: expr │
└──────────────┘ └──────┬───────┘
▲ │ ▲
│ state ▼ │ state
better ┌────────┴─────┐ better ┌────────┴─────┐
null ◄──┤ Sequence │◄─────────┤ Sequence │
│ │ worse │ │ worse
└──────┬───────┴─────────►└──────────────┴──► null
parentExpr │ ▲
▼ │ best
┌────────┴─────┐
│ Expression │
│ root: true │
│ globalIdx: 0 │
└──────────────┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment