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
-
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.
SourceName RegEx yTypeInteger 0 | -? [1-9] [0-9]* yTypeFloat -? [1-9] ( \. [0-9]* [1-9] )? ( e [-+] [1-9] [0-9]* )? yTypeFloatInf -? \. (inf | Inf | INF) yTypeFloatNaN -? \. (nan | NaN | NAN) yTypeBoolTrue y|Y|yes|Yes|YES|true|True|TRUE|on|On|ON yTypeBoolFalse n|N|no|No|NO|false|False|FALSE|off|Off|OFF yTypeNull ~ | null | Null | NULL yTypeUnknown *