rename Scanner output field to tokens

This commit is contained in:
pony 2023-04-01 14:42:56 +13:00
parent c416b31a40
commit cc080b1338
1 changed files with 4 additions and 4 deletions

View File

@ -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) {