Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Missing traceback line hinting #24

Closed
3 tasks done
Tracked by #25 ...
Luna-Klatzer opened this issue Apr 28, 2022 · 0 comments · Fixed by #25 or #33
Closed
3 tasks done
Tracked by #25 ...

[Bug] Missing traceback line hinting #24

Luna-Klatzer opened this issue Apr 28, 2022 · 0 comments · Fixed by #25 or #33
Assignees
Labels
bug Bug or issue in the language or API

Comments

@Luna-Klatzer
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

I am following the documentation's guide

  • I have read the documentation

This issue exists in the latest version

  • I am using the latest version

Current Behavior

When compiling a program errors are only thrown with their line, column and exception name, but they do not contain any line of code displaying the origin of the error.

Example:

var x: num = 4; 
var x: num = 5;

Traceback:

Traceback:
  File 'anonymous-script', line 2, col 0:    
InvalidOverwriteError: Definition of variable 'x' already exists. May not overwrite existing definitions.

Expected Behavior

The traceback should contain the original line of the error.

Expected traceback:

Traceback:
  File 'anonymous-script', line 2, col 0:    
    var x: num = 5;
    ^^^^^^^^^^^^^^^
InvalidOverwriteError: Definition of variable 'x' already exists. May not overwrite existing definitions.

Steps To Reproduce

  1. Compile a program using KipperCompiler.compile() or KipperProgramContext.compileProgram() with invalid code.
  2. Get exception using try { } catch (e) {}
  3. Fetch traceback using e.getTraceback()

Environment

  • Kipper: v0.3.0
  • Operating System (+ Version): Windows 10 - 19043.1645
@Luna-Klatzer Luna-Klatzer self-assigned this Apr 28, 2022
@Luna-Klatzer Luna-Klatzer added bug Bug or issue in the language or API question Further information is requested labels Apr 28, 2022
@Luna-Klatzer Luna-Klatzer changed the title [BUG] Kipper Compile Errors don't display the line of code causing the error [BUG] Missing line of origin in Kipper Errors Apr 28, 2022
@Luna-Klatzer Luna-Klatzer changed the title [BUG] Missing line of origin in Kipper Errors [Bug] Missing line of origin in Kipper Errors Apr 28, 2022
@Luna-Klatzer Luna-Klatzer changed the title [Bug] Missing line of origin in Kipper Errors [Bug] Missing traceback line hinting Apr 28, 2022
@Luna-Klatzer Luna-Klatzer removed the question Further information is requested label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or issue in the language or API
Projects
1 participant