syntax_rust/lib.rs
1//! Highlights Rust code.
2
3#![warn(missing_debug_implementations, rust_2018_idioms)]
4
5mod grammar;
6mod lexer;
7mod parser;
8
9use lexer::{lex, Token, TokenKind};
10use parser::Parser;
11
12#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
13pub struct Highlighter;
14
15impl dialect::Highlight for Highlighter {
16 fn highlight(&self, input: &str) -> Vec<dialect::HighlightedSpan> {
17 Parser::new(input).parse()
18 }
19}