Function phile::lexer::lex
[−]
[src]
pub fn lex<'a, S: AsRef<str>>(sources: &'a [S]) -> Result<Vec<Token<'a>>>
Given an array of source strings, returns an array of tokens extracted from those strings, or an error if there is a syntactic (more precisely, lexical) error in any of the source strings.
Arguments
sources: a slice ofstr-convertible source strings.
Return value
Ok(Vec<Token>)if the source files were lexically correct.Err(Error::Syntax)if there was a lexical error in the input.