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

better errors part 1 #23

Merged
merged 13 commits into from
May 25, 2018
Merged

better errors part 1 #23

merged 13 commits into from
May 25, 2018

Conversation

acook
Copy link
Owner

@acook acook commented Oct 4, 2016

This isn't the end-all-be-all of errors, more work will be done in the future, but figuring out where in a file the error occured is indeterminable from Go panic dumps, so leads to a lot of guesswork.

Errors should say which...

  • source file
  • token name
  • line in the source file
  • column on that line in the source file

..the error occured on.

Including which Go file/line the error was generated on is useful too. The token number and raw byte offset in the .bl source is good for debugging how tokens are parsed, but might be removed later. Most of the info in this paragraph already exists.

  • source mapping (in-memory only)
  • CLI argument errors
  • Compiler errors when encountering invalid tokens

acook added 10 commits December 6, 2016 03:36
- Tag: gets Error() so it can fulfill Go's error interface
- compiler: constructs a Tag with multiple tags that contain info about
the error
- instructions/blacklight.go: have to pass in a filename and receive err

Next Steps
----------

- Replace filename with an "environment" object that contains filename
and other metadata for better errors
- Store *.bl source file info in file_env object and use it in the
compiler or anywhere else it is needed
- Source map for keeping track of bytecodes vs file offsets
- Decompile bytecodes upon error
@acook
Copy link
Owner Author

acook commented Dec 11, 2016

Code duplication between co, do, bload, and t_to_b will need to be addressed in this card.

@acook
Copy link
Owner Author

acook commented Dec 11, 2016

refactor VM

@acook
Copy link
Owner Author

acook commented May 25, 2018

@acook acook changed the title better errors (wip) better errors part 1 May 25, 2018
@acook acook merged commit 16e40d5 into master May 25, 2018
@acook acook deleted the internal_errors branch May 25, 2018 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant