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 psyntax error messages #80

Open
3 of 9 tasks
higepon opened this issue Sep 15, 2022 · 0 comments
Open
3 of 9 tasks

Better psyntax error messages #80

higepon opened this issue Sep 15, 2022 · 0 comments
Assignees
Labels

Comments

@higepon
Copy link
Owner

higepon commented Sep 15, 2022

Goal

  • Make psyntax error message as good as mosh backend. Show file name and line number as much as possible.

Todo

  • Remove bad set-source-info! call and preserve source-info.
  • Improve "invalid syntax" case
  • Improve "macro error" case
  • Have assert(ae) in build-lambda and fix it.
  • Improve "runtime error" case
  • Improve "invalid syntax in library" case.
  • Improve "runtime error in library" case.
  • Add tests for the cases above.
  • Hopefully we should follow whatever psyntax has.

Some examples

1

(import (rnrs) (mosh))

(define (a) 3)

(display (a 3))

 Condition components:
 1. &assertion
 2. &who             who: "(a) : unknown location"
 3. &message         message: "wrong number of arguments (required 0, got 1)"
 4. &irritants       irritants: ((3))

2

(import (rnrs))

(define-syntax a
  (syntax-rules ()
    ((_) 3)))

(display (a 4))

./mosh r.scm 
 Condition components:
 1. &message       message: "invalid syntax"
 2. &syntax        form: (a 4)
                   subform: #f

 Exception:
     error in raise: returned from non-continuable exception
@higepon higepon self-assigned this Sep 15, 2022
@higepon higepon changed the title Keep source-info in annotation-expression method Better psyntax error messages Sep 15, 2022
@higepon higepon added the p2 label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant