Repository navigation
Commit 5237eff
Parse and wrap ansi() codes without per-code allocations (#55)
* Parse and wrap ansi() codes without per-code allocations
AnsiCodeParser reads codes in place (no iterator, StringBuilder or
per-token strings) and shares palette colour instances. MarkupSet
caches one-layer sets and Append results, and compares by reference
first. MarkupText skips the normalising copy when runs are already
normal. AnsiStyle equality/hash use one bit field; AnsiMarkup caches
its hash.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxaBeF4BjQBGHyZCqibsLX
* Narrow the parser's allocation claim to palette colours
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxaBeF4BjQBGHyZCqibsLX
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b47d2c1 commit 5237eff
9 files changed
Lines changed: 389 additions & 152 deletions
File tree
- MarkupString.Ansi
- MarkupString.Tests
- Ansi
- MarkupString
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| |||
0 commit comments