Skip to content

Streamy version #4

Description

@mlutze
   /// for writing safely
    pub enum JsonStream[r: Region] {
        case JsonObject(Iterator[(String, JsonStream[r]), r])
        case JsonArray(Iterator[JsonStream[r], r])
        case JsonString(String)
        case JsonInt(Int32)
        case JsonFloat(Float64)
        case JsonBool(Bool)
        case JsonNull
    }

   /// for reading with error possibility
    pub enum JsonResult[r: Region] {
        case JsonObject(Iterator[(String, JsonResult[r]), r])
        case JsonArray(Iterator[JsonResult[r], r])
        case JsonString(String)
        case JsonInt(Int32)
        case JsonFloat(Float64)
        case JsonBool(Bool)
        case JsonNull
        case JsonErr
    }
  • To start: We can read from an Iterator[Char]
  • maybe later advance to Iterator[String] and/or Iterator[Array[Byte]]
  • Normal parser can delegate to this
  • to- and from- stream operations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions