A Rust library for making beautiful REPLs and Shells with fish like as you type syntax highlighting
```rust use std::process::exit; use synterm::{genlexer, genparse, syntaxhighlightgen, Color, CommandLineTool};
struct MyTool;
impl CommandLineTool for MyTool { fn evaluatorfunction(line: &String) -> String { match line.asstr() { "exit" => { exit(0); } _ => format!("Line: {}", line), } } fn syntaxhighlight(string: &str) { syntaxhighlight_gen!( TheLexer, parser, (Foo, Color::Red, "foo"), (Bar, Color::Green, "bar"), (Baz, Color::Blue, "baz") ); parser(TheLexer::lexer(string)); } }
fn main() { MyTool.start(); } ```
Add the following to your Cargo.toml's dependency section
toml
synterm = "0.2.11"
logos = "0.9.7"
See TODO.md for ways to contribute
Open it in Gitpod everything is all ready for you!