def json.tok

yaml-for-bend@0.1.1.0 · scan.bend:420

import yaml-for-bend@0.1.1.0/scan.bend as Scan
import Base
import yaml-for-bend@0.1.1.0/token.bend as T

420# The token before this one: whether it was a JSON-like node (a quoted
421# scalar or a flow collection), after which ":" is a value indicator even
422# without a space.
423def json.tok(t: T.Tok) -> Bool:
424  match t:
425    case T.ScalarTok{text, style}:
426      match style:
427        case T.Single{}:
428          True{}
429        case T.Double{}:
430          True{}
431        case _:
432          False{}
433    case T.FSeqEnd{}:
434      True{}
435    case T.FMapEnd{}:
436      True{}
437    case _:
438      False{}

Uses (3)

Used by (1)