type Mode

emerging-ezjson@1.3.0.0 · src/pull.bend:79

import emerging-ezjson@1.3.0.0/src/pull.bend as Pull
import Base
import emerging-ezjson@1.3.0.0/src/value.bend as V

79# what the scanner is inside. Skip-modes (`MSk*`) walk a string they will
80# not keep, so a dropped value does not build its text
81type Mode is Data:
82  MIdle{}
83  # a bare word's characters, reversed, so the unread array is not kept
84  MWord{buf: List<&2, Char>, nn: U32, num: V.Num}
85  MSpan{cut: String, nn: U32}
86  MCopy{buf: List<&2, Char>}
87  MEsc{buf: List<&2, Char>}
88  MUni{left: Nat, acc: U32, buf: List<&2, Char>}
89  MHi{hi: U32, buf: List<&2, Char>}
90  MHiEsc{hi: U32, buf: List<&2, Char>}
91  MLo{left: Nat, acc: U32, hi: U32, buf: List<&2, Char>}
92  MSkStr{}
93  MSkEsc{}
94  MSkUni{left: Nat, acc: U32}
95  MSkHi{hi: U32}
96  MSkHiEsc{hi: U32}
97  MSkLo{left: Nat, acc: U32, hi: U32}
98  MDone{stop: Stop, saved: String}
99  # the cursor rest is the suffix the stepper is already on, so closing a
100  # long string does not keep that suffix a second time
101  MRest{stop: Stop}
102  # the quote is consumed; the next character is the first of the string
103  MQuote{}
104  # resume `mode` on `rest` after a plain word, which the stepper did not
105  # walk byte by byte
106  MJump{rest: String, mode: Mode}

Uses (7)

Used by (42)