yamleam/scalar
Plain scalar resolution.
Converts the verbatim text of a plain (unquoted) scalar into a typed
YamlNode according to YAML 1.2 resolution rules. Quoted scalars are
always strings and bypass this layer entirely.
Resolution priority (first match wins):
- Empty / “null” / “Null” / “NULL” / “~” → YamlNull
- “true” / “True” / “TRUE” → YamlBool(True)
- “false” / “False” / “FALSE” → YamlBool(False)
- Decimal integer (optional sign) → YamlInt
- Decimal float (optional sign, exponent) → YamlFloat
- Otherwise → YamlString
Following YAML 1.2, the YAML 1.1 boolean variants (“yes”, “no”, “on”, “off”) and leading-zero octals (“0777”) resolve as strings. Hex and octal integers (“0x1F”, “0o17”) and the special floats (“.inf”, “.nan”) currently resolve as strings too.
Values
pub fn resolve(text: String) -> node.YamlNode