Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chimehq/lowlight
A simple syntax processing system that prioritizes latency over correctness
https://github.com/chimehq/lowlight
highlighting ios macos parser parsing swift syntax-highlighting
Last synced: about 3 hours ago
JSON representation
A simple syntax processing system that prioritizes latency over correctness
- Host: GitHub
- URL: https://github.com/chimehq/lowlight
- Owner: ChimeHQ
- License: bsd-3-clause
- Created: 2024-01-23T15:04:00.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-05-01T17:18:53.000Z (7 months ago)
- Last Synced: 2024-05-02T12:09:39.198Z (7 months ago)
- Topics: highlighting, ios, macos, parser, parsing, swift, syntax-highlighting
- Language: Swift
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![Build Status][build status badge]][build status]
[![Discord][discord badge]][discord]# Lowlight
A simple syntax processing system that prioritizes latency over correctness- partial document "parsing"
- Very simple data-based description of languages
- Get information about tokens and scopesYou may be wondering why someone would ever want something like this. To do accurate syntax analysis, you have to parse. Parsing requires processing a document, in its entirety, from beginning to end.
- The parsing system itself requires initialization
- The document must then be parsed
- Some queries must be run over the parse tree to get the needed informationAll of these components require non-zero time, and that time scales, at best, linearly with the size of the document. Lowlight can process fragments of documents. It does not produce parse trees, only enough information to make reasonable guesses at tokens and scopes.
Lowlight is useful as very fast first pass. It fits in well with a multi-pass highlighting system like [Neon][neon].
> [!WARNING]
> This is currently very WIP.## Installation
```swift
dependencies: [
.package(url: "https://github.com/ChimeHQ/Lowlight", branch: "main")
],
```## Contributing and Collaboration
I would love to hear from you! Issues, Discussions, or pull requests work great. A [Discord server][discord] is also available for live help, but I have a strong bias towards answering in the form of documentation.
I prefer collaboration, and would love to find ways to work together if you have a similar project.
I prefer indentation with tabs for improved accessibility. But, I'd rather you use the system you want and make a PR than hesitate because of whitespace.
By participating in this project you agree to abide by the [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
[build status]: https://github.com/ChimeHQ/Lowlight/actions
[build status badge]: https://github.com/ChimeHQ/Lowlight/workflows/CI/badge.svg
[discord]: https://discord.gg/esFpX6sErJ
[discord badge]: https://img.shields.io/badge/Discord-purple?logo=Discord&label=Chat&color=%235A64EC
[neon]: https://github.com/ChimeHQ/Neon