DulLabs / bhai-lang

A toy programming language written in Typescript
https://bhailang.js.org/
MIT License
3.97k stars 501 forks source link

Feature Request: Show the line number of the incorrect statement along with the compiler error. #248

Open f1ypopper opened 2 years ago

f1ypopper commented 2 years ago

Is your feature request related to a problem? Please describe.

Right now the compiler/parser only shows the error and doesn't show the specific line number.This can make the parser errors much more verbose.

Describe the solution you'd like.

Add a line field to the token class which is tracked and incremented in the scanner. The line number can be shown be shown along with the parser error.

Describe alternatives you've considered

No response

Additional context.

No response

f1ypopper commented 2 years ago

I can work on this issue.