1use jrsonnet_lexer::Lexer;2use rowan::{TextRange, TextSize};34use crate::SyntaxKind;56#[derive(Clone, Copy, Debug)]7pub struct Lexeme<'s> {8 pub kind: SyntaxKind,9 pub text: &'s str,10 pub range: TextRange,11}1213pub fn lex(input: &str) -> Vec<Lexeme<'_>> {14 Lexer::new(input)15 .map(|l| Lexeme {16 kind: SyntaxKind::from_raw(l.kind.into_raw()),17 text: l.text,18 range: TextRange::new(TextSize::from(l.range.0), TextSize::from(l.range.1)),19 })20 .collect()21}difftreelog
source
crates/jrsonnet-rowan-parser/src/lex.rs460 Bsourcehistory