Skip to content

Commit

Permalink
using push api
Browse files Browse the repository at this point in the history
  • Loading branch information
alfanick committed Dec 22, 2016
1 parent 2ce7ace commit 3dfafe6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parser.rs
Expand Up @@ -187,17 +187,17 @@ impl TokensProcessor for Parser {
let mut stack = TokenList::with_capacity(4);
let mut iter = tokens.tokens.iter().peekable();

self.output.tokens.clear();
self.output.clear();
self.output.identifiers = tokens.identifiers.clone();

while let Some(&(position, ref token)) = iter.next() {
match *token {
Token::Number(_) => self.output.tokens.push((position, token.to_owned())),
Token::Number(_) => self.output.push(position, token.to_owned()),
Token::Identifier(_) => {
if let Some(&&(_, Token::BracketOpening)) = iter.peek() {
stack.push((position, token.to_owned()));
} else {
self.output.tokens.push((position, token.to_owned()));
self.output.push(position, token.to_owned());
}
},
Token::Operator(name) => {
Expand Down

0 comments on commit 3dfafe6

Please sign in to comment.