Substract 1 to the lexed vector's size in Parser.hpp to avoid getting out of bounds because of the next reference.
This commit is contained in:
parent
07ca24c610
commit
b82faeb399
@ -7,7 +7,7 @@ namespace Parser {
|
|||||||
ParseTree parseVector(const vector<tok>& lexed) {
|
ParseTree parseVector(const vector<tok>& lexed) {
|
||||||
ParseTree parseTree;
|
ParseTree parseTree;
|
||||||
using namespace StandardComponents::types;
|
using namespace StandardComponents::types;
|
||||||
for (unsigned int i = 0; i < lexed.size(); ++i) {
|
for (unsigned int i = 0; i < lexed.size() - 1; ++i) {
|
||||||
const auto& current = lexed[i];
|
const auto& current = lexed[i];
|
||||||
const auto& next = lexed[i + 1];
|
const auto& next = lexed[i + 1];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user