daeisbae / AParser

Yet another programming language for educational purpose and simplicity
https://daeisbae.github.io/AParser/
MIT License
1 stars 0 forks source link

Returns err msg of invalid char if invalid char is read by lexer #16

Closed daeisbae closed 6 months ago

daeisbae commented 6 months ago

For example, If ; is read by lexer during tokenization, it will return an error message stating that it is a invalid char.

./AParser                                                                                                                                     
>>> 1 + 1;
Token( TokenType: Integer Value: '1' )
Token( TokenType: Whitespace Value: ' ' )
Token( TokenType: Operator Value: '+' )
Token( TokenType: Whitespace Value: ' ' )
Token( TokenType: Integer Value: '1' )
libc++abi: terminating due to uncaught exception of type WrongLexingException: Token: ';' is not allowed
[1]    14289 abort      ./AParser