TomlParser

Usage

use TOML.TomlParser;

or

import TOML.TomlParser;

Parser module with the Toml class for the Chapel TOML library.

config const debugTomlParser = false

Prints a line by line output of parsing process

class Toml

Class to hold various types parsed from input used to recursively hold tables and respective values

proc init()
proc init(s: string)
proc init(A: [?D] unmanaged Toml)
proc init(ld: date)
proc init(ti: time)
proc init(dt: datetime)
proc init(i: int)
proc init(boo: bool)
proc init(re: real)
proc init(arr: [?dom] unmanaged Toml)
proc init(lst: list(unmanaged Toml))
proc init(root: unmanaged Toml)
proc this(tbl: string) ref: unmanaged nilable Toml throws

Returns the index of the table path given as a parameter

proc set(tbl: string, toml: unmanaged nilable Toml)
proc set(tbl: string, s: string)
proc set(tbl: string, i: int)
proc set(tbl: string, b: bool)
proc set(tbl: string, r: real)
proc set(tbl: string, ld: date)
proc set(tbl: string, ti: time)
proc set(tbl: string, dt: datetime)
proc set(tbl: string, A: [?D] unmanaged nilable Toml)
proc set(tbl: string, arr: [?dom] unmanaged nilable Toml)
override proc writeThis(f) throws

Write a Table to channel f in TOML format

proc writeTOML(f)

Write a Table to channel f in TOML format

proc writeJSON(f)

Write a Table to channel f in JSON format

proc toString(): string

For the user to write values of a node as follows: Toml[key].toString()

proc tomlType: string throws

Return Toml type as a string.

Valid types include:

  • empty

  • string

  • integer

  • float

  • boolean

  • datetime

  • array

  • toml (inline table)