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 : writeSerializable
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] shared Toml) where D.isAssociative()
- 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] shared Toml) where dom.isAssociative() == false
- proc init(lst: list(shared Toml))
- proc init(root: Toml)
- proc this(tbl: string) ref : shared Toml? throws
Returns the index of the table path given as a parameter.
- Throws:
TomlError – If no index could be found for the given table path.
- proc set(tbl: string, toml: 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] shared Toml?) where D.isAssociative()
- proc set(tbl: string, arr: [?dom] shared Toml?) where !dom.isAssociative()
- override proc serialize(writer, ref serializer) throws
Write a Table to channel f in TOML format.
- Throws:
TomlError – If an error occurred serializing the table, such as due to missing values or unsupported types.
- 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)
- Throws:
TomlError – If this is not a known TOML type.