abla/yaml/value
Generated from source.
Source module; follow its importing module's re-export links.
Source: abla/yaml/value.ab
YamlNumber (class)
class YamlNumber(val text: string, val integer: bool, val intValue: int,
val intAvailable: bool, val canonical: string, val valid: bool)
Numeric text is exact, including integers outside int's range and .inf/.nan. canonical is an exact decimal key identity, never an f64 conversion.
Yaml (class)
class Yaml(val kind: int, val stringValue: string, val boolValue: bool,
val keys: array<Yaml>, val values: array<Yaml>, val numberValue: YamlNumber)
Kinds: 0 null, 1 string, 2 number, 3 boolean, 4 sequence, 5 mapping. Values are immutable by convention, including the supplied arrays.
YamlError (class)
class YamlError(val code: string, val message: string, val byteOffset: int,
val line: int, val column: int)
A YAML diagnostic with a code, message, zero-based byte offset, and one-based line and column.
YamlParseResult (class)
class YamlParseResult(val value: Yaml, val succeeded: bool, val error: YamlError)
The parsed YAML value when succeeded is true. A failed parse returns YAML null and the diagnostic in error.
YamlLimits (class)
class YamlLimits(
val maximumBytes: int = 1048576,
val maximumDepth: int = 64,
val maximumNodes: int = 100000,
val maximumScalarBytes: int = 1048576,
val maximumCollectionMembers: int = 10000,
val maximumAnchors: int = 1000,
val maximumAliases: int = 1000,
val maximumExpandedNodes: int = 100000,
val maximumExpandedScalarBytes: int = 8388608,
val maximumNumberBytes: int = 1024,
val maximumWork: int = 20000000
)
Bounds YAML input or emitted bytes, depth, nodes, scalar and collection sizes, anchors, aliases, expanded content, numeric text, and work. Use yamlDefaultLimits for the standard bounds.
yamlEmptyValues (val)
@threadShared val yamlEmptyValues: array<Yaml>
Holds the empty child list used by values without children.
yamlEmptyNumber (val)
@threadShared val yamlEmptyNumber
Holds the invalid numeric placeholder used for nonnumber values.
yamlDefaultLimits (fun)
fun yamlDefaultLimits(): YamlLimits
Returns the standard parser and emitter limits.
yamlLimitsValid (fun)
fun yamlLimitsValid(l: YamlLimits): bool
Returns whether the YAML limits are in the supported ranges.
yamlNull (fun)
fun yamlNull(): Yaml
Returns the YAML null value.
yamlString (fun)
fun yamlString(value: string): Yaml
Wraps value as a YAML string. Text validity is checked by the emitter when serializing.
yamlBoolean (fun)
fun yamlBoolean(value: bool): Yaml
Returns the YAML boolean for value.
yamlSequence (fun)
fun yamlSequence(values: array<Yaml>): Yaml
Wraps values in a YAML sequence, preserving their order.
yamlMapping (fun)
fun yamlMapping(keys: array<Yaml>, values: array<Yaml>): Yaml
Wraps keys and values in an ordered YAML mapping. Supply one value per key. This constructor stores the arrays as given.
yamlObject (fun)
fun yamlObject(keys: array<string>, values: array<Yaml>): Yaml
Wraps string keys as YAML string scalars and pairs them with values in order. Supply one value per key.
Yaml.isNull (extension fun)
fun Yaml.isNull(): bool
Returns whether the value is YAML null.
Yaml.isString (extension fun)
fun Yaml.isString(): bool
Returns whether the value is a string.
Yaml.isNumber (extension fun)
fun Yaml.isNumber(): bool
Returns whether the value is a number.
Yaml.isBoolean (extension fun)
fun Yaml.isBoolean(): bool
Returns whether the value is a boolean.
Yaml.isSequence (extension fun)
fun Yaml.isSequence(): bool
Returns whether the value is a sequence.
Yaml.isMapping (extension fun)
fun Yaml.isMapping(): bool
Returns whether the value is a mapping.
Yaml.asString (extension fun)
fun Yaml.asString(): string
Returns the string scalar or an empty string for other kinds.
Yaml.asBoolean (extension fun)
fun Yaml.asBoolean(): bool
Returns the boolean scalar or false for other kinds.
Yaml.asInt (extension fun)
fun Yaml.asInt(): int
Returns the integer scalar's value, or zero if it cannot be read as an int.
Yaml.intAvailable (extension fun)
fun Yaml.intAvailable(): bool
Returns true when this is a numeric scalar with an available int value.
Yaml.asNumber (extension fun)
fun Yaml.asNumber(): YamlNumber
Returns the stored numeric value, whose validity field identifies a usable number.
Yaml.size (extension fun)
fun Yaml.size(): int
Returns the number of stored values in a sequence or mapping, or zero for a scalar.
Yaml.at (extension fun)
fun Yaml.at(index: int): Yaml
Returns the stored value at zero-based index. An out-of-bounds index panics.
yamlScalarKey (fun)
fun yamlScalarKey(value: Yaml): string
Returns a type-prefixed scalar key identity or a sentinel for a collection.
Yaml.keyIndex (extension fun)
fun Yaml.keyIndex(key: Yaml): int
Returns the index of the first matching scalar mapping key or -1 when absent.
Yaml.hasKey (extension fun)
fun Yaml.hasKey(key: Yaml): bool
Returns whether the mapping contains a matching scalar key, including one mapped to null.
Yaml.getKey (extension fun)
fun Yaml.getKey(key: Yaml): Yaml
Looks up the scalar key in a mapping using its YAML type and value. Returns the first matching value or YAML null when absent.
Yaml.get (extension fun)
fun Yaml.get(key: string): Yaml
Returns the value for string key, or YAML null when absent.
Yaml.has (extension fun)
fun Yaml.has(key: string): bool
Returns true if the mapping contains string key, including keys whose value is YAML null.
yamlDigit (fun)
fun yamlDigit(c: int): int
Returns the value of a hexadecimal digit or -1 for another byte.
yamlUnsignedDecimal (fun)
fun yamlUnsignedDecimal(text: string): string
Returns decimal text without redundant leading zeroes and uses zero for empty input.
yamlExponentAdd (fun)
fun yamlExponentAdd(text: string, displacement: int): string
Exact signed decimal + a small displacement (fraction/trailing-zero count).
yamlIntegerCanonical (fun)
fun yamlIntegerCanonical(text: string, start: int, radix: int, negative: bool): string
Converts the specified signed radix digits to canonical decimal text.
yamlIntegerAvailable (fun)
fun yamlIntegerAvailable(text: string): bool
Returns whether the canonical decimal integer fits the available signed 64-bit range.
yamlNumberKind (fun)
fun yamlNumberKind(text: string): int
1 integer, 0 float, -1 string. YAML Core deliberately treats malformed number-looking plain scalars as strings (0o9, +0xA and 1_000 included).
yamlNumberText (fun)
fun yamlNumberText(text: string): Yaml
Returns a numeric node preserving the supplied spelling and marks invalid or oversized numeric text as invalid.
yamlInteger (fun)
fun yamlInteger(value: int): Yaml
Returns a YAML integer value for the supplied signed integer.
yamlResolvePlain (fun)
fun yamlResolvePlain(text: string): Yaml
Resolves a plain scalar according to YAML Core and uses a string when no other scalar kind matches.
yamlCopy (fun)
fun yamlCopy(value: Yaml): Yaml
Copies the YAML value record while sharing immutable contents.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.