I-Language-Development / I-language-python

The I programming language is a high level programming language written in pure python.
https://i-language.readthedocs.io
MIT License
3 stars 0 forks source link

[FEATURE] Add "real" traceback #13

Open ElBe-Plaq opened 1 year ago

ElBe-Plaq commented 1 year ago

Is your feature request related to a problem? Please describe. When an error occurs, you don't have a great way to find, which part of the code produced it.

Describe the solution you'd like Good looking, maybe even colored Traceback, like in python or C.

Describe alternatives you've considered Keep it as it is and look up the code for yourself. (Line number and column get printed as usual)

ElBe-Plaq commented 1 year ago

What about something like this:

Error: Division by zero, in line 0, column 0.
Division by zero is not allowed.

1 / 0.00000
     ^~~~~
ElBe-Plaq commented 1 year ago

Or more like the python style:

Traceback (most recent call last):
  File "example.ilang", in line 2, column 4
     1 / this_is_zero
          ^^^^^^^
  File "example.ilang", in line 1, column 20
    var this_is_zero = 0
Division by zero: Dividing by zero is not allowed.
ElBe-Plaq commented 1 year ago

The arrows are not formatted properly, because of my browsers font.

ElBe-Plaq commented 1 year ago

I'll go with the second one.