Module yaml/hints
The hints API enables you to guess the type of YAML scalars.
Imports
Types
TypeHint = enum yTypeInteger, yTypeFloat, yTypeFloatInf, yTypeFloatNaN, yTypeBoolTrue, yTypeBoolFalse, yTypeNull, yTypeUnknown, yTypeTimestamp
-
A type hint can be computed from scalar content and tells you what NimYAML thinks the scalar's type is. It is generated by guessType The first matching RegEx in the following table will be the type hint of a scalar string.
You can use it to determine the type of YAML scalars that have a '?' non-specific tag, but using this feature is completely optional.
See also: https://yaml.org/spec/1.2.2/#103-core-schema
Name RegEx yTypeInteger [-+]? [0-9]+ yTypeFloat [-+]? ( \. [0-9]+ | [0-9]+ ( \. [0-9]* )? ) ( [eE] [-+]? [0-9]+ )? yTypeFloatInf [-+]? ( \.inf | \.Inf | \.INF ) yTypeFloatNaN \.nan | \.NaN | \.NAN yTypeBoolTrue true | True | TRUE yTypeBoolFalse false | False | FALSE yTypeNull null | Null | NULL | ~ yTypeTimestamp see here. yTypeUnknown *