def AaLex.word.go

bend-osdev-apparmor@0.1.0.0 · token.bend:225

import bend-osdev-apparmor@0.1.0.0/token.bend as Token
import Base
import bend-osdev-apparmor@0.1.0.0/text.bend as X

225def AaLex.word.go(k: AaLxCh, +st: AaLex, +acc: List<&2, U32>, +depth: Nat, +h: U32, +next: U32) -> AaLex:
226  match k:
227    case AaLxCWs{}:
228      AaLex.space(AaLex.word_end(st, acc), h)
229    case AaLxCNl{}:
230      AaLex.space(AaLex.word_end(st, acc), h)
231    case AaLxCComma{}:
232      AaLex.word.comma(Bool.or(Nat.is_gt(depth, 0n), Bool.not(Bool.or(Nat.is_gt(AaLex.pdepth(st), 0n), AaLxCh.ends(next)))), st, acc, depth, h)
233    case AaLxCLP{}:
234      AaLex.word.lp(Bool.and(Nat.is_eq(depth, 0n), U32.is_eq(X.AaText.head(acc), 61)), st, acc, depth, h)
235    case AaLxCRP{}:
236      AaLex.word.rp(Bool.and(Nat.is_eq(depth, 0n), Nat.is_gt(AaLex.pdepth(st), 0n)), st, acc, depth, h)
237    case AaLxCOpen{}:
238      AaLex.keep(st, acc, 1n+depth, h)
239    case AaLxCClose{}:
240      AaLex.word.close(depth, st, acc, h)
241    case AaLxCQuote{}:
242      AaLex.mode(AaLex.word_end(st, acc), AaLxQuote{Nil{}, False{}})
243    case AaLxCHash{}:
244      AaLex.keep(st, acc, depth, h)
245    case AaLxCOther{}:
246      AaLex.keep(st, acc, depth, h)

Uses (24)

Used by (1)