Set error Index for edge cases
Set error index to last token as a workaround for cases that escape initial error parsing. This does not sets the exact index where the error is located but for now avoids unexpected seg-fault erros.
(cherry picked from commit 4776dc3c)
Co-authored-by: Gabriel Barrantes gabriel.barrantes.dev@outlook.com