Description
Classify whole-line comments in a restricted INI dialect using first non-SP/HTAB semicolon or hash; not inline comment stripping or quote handling.
INI-like configuration formats vary between applications. In this tool family, assignments are explicit section/name/value records and the empty section string means global scope. Duplicate-key policies, case handling and preservation of comments are separate choices rather than one universal INI behavior.
Classify whole-line comments in a restricted INI dialect using first non-SP/HTAB semicolon or hash; not inline comment stripping or quote handling.
When to use this tool
Use this tool to classify whole-line comments in a restricted INI dialect using first non-SP/HTAB semicolon or hash; not inline comment stripping or quote handling.
How to use the tool and how it works
- Enter line using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.comment, result.marker. Use the ordering, boundary rules and absence conditions described below.
Reject line breaks, remove leading spaces and tabs, and check whether the first remaining character is semicolon or hash. Return the marker or null.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| line | One INI-dialect line; accepted whitespace depends on the operation. | Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.comment | Whether the line begins with a supported comment marker after spaces/tabs. |
| result.marker | Semicolon or hash marker, or null for a non-comment line. |
{
"input": {
"line": " # x"
},
"output": {
"result": {
"comment": true,
"marker": "#"
}
}
} Limitations and assumptions
- Only full-line comments in this declared dialect are classified; inline markers are not parsed.
- Assignment records contain section, name and value strings. Nonempty section/key names cannot have surrounding whitespace, brackets or CR/LF/NUL. Values cannot contain CR/LF/NUL; a key cannot contain equals. No implicit interpolation or typed-value conversion is performed.
- Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.
Alternative or Complementary methods
Select the consuming application’s dialect and duplicate-key policy explicitly. Use a lossless configuration editor when comments, original spacing, quoting or application-specific interpolation must be preserved.
References
Similar or alternative tools
- INI Line Kind Tokenizer
Tokenize restricted INI physical lines into blank/comment/section/trimmed equals assignments; no multiline, escaping, interpolation, inline comments or inheritance.
- INI Section Name Line Formatter
Format a literal nonempty trimmed INI section name for the restricted bracketed dialect; no escaping, nesting or case normalization.