rename Scanner output field to tokens
This commit is contained in:
parent
c416b31a40
commit
cc080b1338
|
@ -6,7 +6,7 @@ use crate::value::Value;
|
|||
use std::collections::HashMap;
|
||||
|
||||
pub struct Scanner {
|
||||
output: Vec<Token>,
|
||||
tokens: Vec<Token>,
|
||||
error: bool,
|
||||
cutter: Cutter,
|
||||
keywords: HashMap<String, TokenType>,
|
||||
|
@ -15,7 +15,7 @@ pub struct Scanner {
|
|||
impl Scanner {
|
||||
pub fn new(input: &str) -> Self {
|
||||
Self {
|
||||
output: Vec::new(),
|
||||
tokens: Vec::new(),
|
||||
error: false,
|
||||
cutter: Cutter::new(input),
|
||||
keywords: keywords::get(),
|
||||
|
@ -32,7 +32,7 @@ impl Scanner {
|
|||
if self.error {
|
||||
None
|
||||
} else {
|
||||
Some(self.output)
|
||||
Some(self.tokens)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ impl Scanner {
|
|||
let lexeme = self.cutter.cut();
|
||||
let token = Token::new(tag, lexeme, value, self.cutter.line);
|
||||
|
||||
self.output.push(token);
|
||||
self.tokens.push(token);
|
||||
}
|
||||
|
||||
fn word(&mut self) {
|
||||
|
|
Loading…
Reference in New Issue