Description
Decode one supported bare or JSON-style double-quoted TOML key segment.
TOML keys and values have distinct bare, quoted, literal-string, and date/time rules. A dotted key consists of segments, and quote prefixes alone do not prove a valid complete string. A local recognizer can intentionally support a smaller grammar than the full language.
Decode one supported bare or JSON-style double-quoted TOML key segment.
When to use this tool
Use Toml Dotted Key Single Segment when you need to inspect one supported TOML-related prefix, key segment, or separator.
How to use the tool and how it works
- Enter segment. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read key, quoted. Inspect quoted before interpreting the associated values.
Accept a bare segment containing ASCII letters, digits, underscores, or hyphens, returning it unchanged with quoted=false. Otherwise require a double-quoted token, decode it using the linked JSON-string parsing behavior, and return the key with quoted=true.1
TOML supports bare keys and keys quoted as basic or literal strings. This implementation's JSON-decoded double-quote branch is a restricted local behavior rather than that full quoted-key grammar.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| segment | Segment | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| key | Key | Required. Text; maximum UTF-16 length 8192. |
| quoted | True only for the accepted JSON-decoded double-quoted branch. | Required. Boolean. |
{
"input": {
"segment": "\"a.b\""
},
"output": {
"key": "a.b",
"quoted": true
}
} Limitations and assumptions
- Only one key segment is handled and JSON escape rules apply to the quoted branch. This is not a full TOML quoted-key implementation, dotted-key splitter, or duplicate-key resolver.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a full TOML parser for complete keys, string escapes, dates, duplicate definitions, and document semantics. Keep this tool's restricted grammar distinct from the language specification.
References
-
Calculation and input contract: parse/toml-dotted-key-single-segment — tool.io
-
TOML 1.0.0: Keys — TOML Language
Similar or alternative tools
- Toml Literal String Quote Count
Identify the one-quote or three-quote opening delimiter of a TOML literal string, including empty literals; this does not parse a complete TOML document.
- Parsing: Dotenv Single Assignment Split
Split a restricted dotenv assignment at its first equals sign, retaining raw value and optional export prefix without evaluating quoting, interpolation or comments.