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

Karel interp uses linenrs from flattened source when displaying errors #13

Open
gavanderhoorn opened this issue Jan 31, 2017 · 2 comments

Comments

@gavanderhoorn
Copy link
Owner

Example:

INTP-368 (PROGNAME, 747) Cannot use specified program
MEMO-073 Program does not exist

There is no line 747 in PROGNAME, or at least, not in the non-preprocessed source of it.

@gavanderhoorn
Copy link
Owner Author

There is probably very little we can do about this as linenrs do not seem to be embedded in the p-code that is generated, but are derived / generated by the pc-loader that is used.

Flattened source does include pre-processor markers that include original line nrs (see #14 for an example), but this is lost in the source->binary transformation (as ktrans.exe does not support any of this).

@gavanderhoorn
Copy link
Owner Author

There is probably very little we can do about this as linenrs do not seem to be embedded in the p-code that is generated, but are derived / generated by the pc-loader that is used.

I just might've found a way around this, as it turns out the linenrs are actually embedded in the p-code. This will require some trickery, but it would seem to be possible.

A problem is that in the case of embedded code (ie: %INCLUDE of a .kl file) it's not clear which line nr should be shown.

Need to investigate what the behaviour of plain ktrans is in such a case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant