From 0350a151a9e5edaf433475cb74e6b919e56bda95 Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Tue, 15 Apr 2025 16:52:31 -0400 Subject: [PATCH] [#1] Initial library setup. Setting up our Rust format file and README. --- .rustfmt.toml | 2 +- README.md | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.rustfmt.toml b/.rustfmt.toml index b85c2b1..121024c 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -16,7 +16,7 @@ wrap_comments = true format_code_in_doc_comments = true doc_comment_code_block_width = 80 comment_width = 80 -normalize_comments = true +normalize_comments = false normalize_doc_attributes = true format_strings = true format_macro_matchers = true diff --git a/README.md b/README.md index 1af20ea..1f782fe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,35 @@ -# rune +# Rune -A simple lexical analysis library. +**Rune** is a high-performance, customizable **lexical analysis library** written in Rust. +It transforms source files into tokens using a fast, cache-friendly design. + +> _“Turn raw text into structured meaning — like spellcraft for source code.”_ + +## Features + +- **Basic tokenization**: Whitespace, text, numbers, symbols, and newlines. +- **Flat `TokenStream` design**: Optimized for speed and cache locality. +- **Custom transforms**: Supply your own function to turn base tokens into domain-specific ones (like Markdown, HTML, or custom Domain Specific Languages). +- **Iterators and mutation**: Traverse or modify tokens efficiently. + + +## Getting Started + +### Add to your project +This library is hosted on the CyberMages registry. To add it to a project the CyberMages registry will need to be added to Cargo as per the [Cargo Book][1]. + +[1]: https://doc.rust-lang.org/cargo/reference/registries.html "The Cargo Book: Registries" + +First add the registry to your cargo config.toml file. + +```toml +[registries.cybermages] +index = "sparse+https://workshop.cybermages.tech/api/packages/CyberMages/cargo/" +``` + +Then add this to your Cargo.toml file. + +```toml +[dependencies] +rune = { registry = "cybermages" } +```