Description
Return line-ending count and conversion byte delta.
Build and configuration formats have dialect-specific quoting, whitespace and escaping rules. A local prefix or character transformation handles only the declared fragment, leaving full parsing, evaluation and precedence to the consuming implementation.
Return line-ending count and conversion byte delta.
When to use this tool
Use Source Line Ending Byte Delta when inspecting the stated text or configuration fragment.
How to use the tool and how it works
- Enter text, convertToCrLf. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read lineBreaks, byteDelta. Use the output convention below.
Return line-ending count and conversion byte delta. Count CRLF pairs and LF not preceded by CR; converting to CRLF adds one byte per lone LF, otherwise removes one per CRLF.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| text | Text | Required. Text; maximum UTF-16 length 8192. |
| convertToCrLf | Convert To Cr Lf | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| lineBreaks | Line Breaks | Required. Safe integer. |
| byteDelta | Byte Delta | Required. Safe integer. |
{
"input": {
"text": "a\nb\r\nc",
"convertToCrLf": true
},
"output": {
"lineBreaks": 2,
"byteDelta": 1
}
} Limitations and assumptions
- Lone CR characters are ignored; text is not rewritten and encoding-dependent byte lengths are not measured.
- 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 the appropriate full parser and actual configuration context for reliable interpretation or application.
References
Similar or alternative tools
- Ninja Variable Dollar Escape
Escape literal dollar signs for a Ninja-style text fragment.
- Makefile Recipe Tab Prefix
Inspect a default-tab Makefile recipe prefix.