Abstractions for working over raw Source Code of typical Programming Languages in TypeScript
| src | ||
| tmp_repl | ||
| .gitignore | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
TypeScript library for handling source code strings.
It has its own String type that deals with unicode in a saner than JS's UTF16 strings.
This take in JS string, and makes it into a fat string SourceText that handles all the insanity of UTF16 in JS (like JS leaking UTF16 internals so that there are code-points spanning multiple indices in the string array).
- it handles NFC Normalization
- makes the original string easy to traverse in error-free way by introducing a character abstraction - type
CodePointand its position within the SourceText calledCodePointIndex - It also tracks where line start (handling various platform specific weirdness like
\r\n)
It also allows for Spatial Tracking or verious sub-regions within the source. It introduces
- point-like
SourceLocationabstraction (basically where a cursor could be) - and interval-like
Spanabstraction (basically what a mouse selection could span)