Explorer

definy.text-parse-string

description
Read a JSON string literal
type
Fn(source: Record{text: String, bytes: List<Number>}, index: Number) -> Union{#ok(Record{value: String, next: Number}), #error(String)}
expression
fn(source$0, index$1) =>
  let start$2 = @definy.text-skip(source: $0, index: $1);
  match @core.equal(left: @definy.text-byte-at(source: $0, index: $2), right: 34) {
    false =>
      #error(@definy.text-error(message: "expected a string", index: $2)),
    true =>
      @definy.text-string-from(
        source: $0,
        index: @core.plus(left: $2, right: 1),
        segment_start: @core.plus(left: $2, right: 1),
        pieces: []
      )
  }
visibility
public
definy.text-parse-string (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: oKiK8rWO030SizaaN2SMKhh321tXOoED151VPrEJ3j4
content hash: NhwIdBRg2qj9djQ6kMbo4buy95tNZs7RQUy8-5HXRYw