Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 400
    • Issues 400
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Wiki
  • Error messages
  • Print Context

Print Context · Changes

Page history
Add file about printing context of error messages. authored Mar 26, 2025 by Quinten Cabo's avatar Quinten Cabo
Hide whitespace changes
Inline Side-by-side
error-messages/Print-Context.md 0 → 100644
View page @ 5fa21d12
# Context around error messages
It would be helpfull to print the surrounding code when an error occurs.
This would make it easier to understand the error message.
Like the error could be: "No instance of function `foo` found in the scope."
But we format it something like this:
```
Not Found Error
Simple.sac:5:4
int main() {
foo();
}
^^^
```
We could try to print the line before and the line afterwards as well.
We could probably just print the one line where it is and do ^^^ below until before the ;
Look at other programming languages how they print their source in errors.
Which ones are the nicest?
\ No newline at end of file
Clone repository
  • Styleguide
  • concepts
    • Deprecated Modules
    • Globals
    • Intermediate Code Macros
    • Named Tuples
    • Overloading
    • Preprocessor
    • Primitive functions
    • Runtime Representations
    • input stdin
    • phm xt
    • ref counting methods
    • type famlies
    • type patterns
  • error messages
    • Anthropomorphic error essages
View All Pages