getAheadSymbol method
returns the position of a symbol in ahead
Implementation
int getAheadSymbol(String lookingFor, List<Token> searchIn) {
for (var index = 0; index < searchIn.length; index++) {
final value = searchIn[index];
if (value.lexeme == lookingFor) {
if (index + 1 < searchIn.length) {
return index + 1;
}
return searchIn.length;
}
}
return -1;
}