Struct rune::Lexer [−][src]
pub struct Lexer<'a> { /* fields omitted */ }
Expand description
Lexer for the rune language.
Implementations
Construct a new lexer over the given source.
Examples
use rune::Lexer; use rune::ast; use runestick::span; assert_eq! { Lexer::new("fn").next().unwrap().unwrap(), ast::Token { kind: ast::Kind::Fn, span: span!(0, 2), } }; assert_eq! { Lexer::new("name").next().unwrap().unwrap(), ast::Token { kind: ast::Kind::Ident(ast::StringSource::Text), span: span!(0, 4), } };