Add token_result() helper
This commit is contained in:
parent
8d00e3afcf
commit
71fb678c50
1 changed files with 4 additions and 0 deletions
|
@ -101,6 +101,10 @@ impl Lexer {
|
||||||
fn error_string(&self, message: String) -> String {
|
fn error_string(&self, message: String) -> String {
|
||||||
format!("{}:{}: {}", self.line, self.line_offset, message)
|
format!("{}:{}: {}", self.line, self.line_offset, message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn token_result(&self, token: Token) -> StateResult {
|
||||||
|
Ok(Some(token))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Lexer {
|
impl Lexer {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue