Remove the "previous" reference in Parser.hpp and start the iteration on lexed tokens at 0 instead of 1.

This commit is contained in:
Username404 2021-07-03 22:32:45 +02:00
parent 3ce905d602
commit f308ad9da0
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -7,8 +7,7 @@ namespace Parser {
ParseTree parseVector(const vector<tok>& lexed) { ParseTree parseVector(const vector<tok>& lexed) {
ParseTree parseTree = ParseTree(); ParseTree parseTree = ParseTree();
using namespace StandardComponents::types; using namespace StandardComponents::types;
for (unsigned int i = 1; i < lexed.size(); ++i) { for (unsigned int i = 0; i < lexed.size(); ++i) {
const auto& previous = lexed[i - 1];
const auto& current = lexed[i]; const auto& current = lexed[i];
const auto& next = lexed[i + 1]; const auto& next = lexed[i + 1];