daeisbae / AParser

Yet another programming language for educational purpose and simplicity
MIT License
0 stars 0 forks source link

Convert "throwing Exceptions" to Warnings Logs in the interpreter #38

Open daeisbae opened 4 months ago

daeisbae commented 4 months ago

Problem

From the example below, we can see that if there's any unexpected error, it just throws an exception. Instead we can return a warning log saying that expected token was a IntegerToken

./AParser 
>>> 1 + 2 +
terminate called after throwing an instance of 'UnexpectedTokenParsedException'
  what():  Unexpected Token: 'Token( TokenType: End of line Value: '' )' is not allowed
Aborted