kyomato/core/README.md
2024-12-01 13:50:40 +02:00

1.1 KiB

So, here comes yet-another token redesign. Thing is, I've found a great Djot parser at https://github.com/hellux/jotdown?tab=readme-ov-file, and run into a problem: they produce tokens containing string references already, which does not work well with my previous design based on separate handling of source and tokens.

Futhermore - there's no REAL reason to do that, I just wanted to be fancy or th :idk:

So, here comes yet-another token redesign. This time, tokens DO contain some-sort-of reference to underlying code, but actual TYPE of this reference is being abstracted on. This way, I would be able to use bytes-based references, &str-based, or whatever crazy Span-like stuff I'll come up with later.

Thing is, jotdown uses both &str and Cow<&str>, depending on if the source should be sanitized, so I'll empose a restriction on a source type to be ToOwned, and will define my own wrapped around &str to resolve to ::beef::Cow<&str> instead.

One more thing I'd like to account for - partial parsing. Also, I'd like for my tree to be fully-modifiable and easily-redactable, so there's that :idk:.