Re: [racket-users] Affecting the errors generated by syntax-parse

2015-07-25 Thread Stephen Chang
I haven't played with the example in detail, but do you want the cut operator here? http://docs.racket-lang.org/syntax/stxparse-patterns.html?q=syntax-parse#%28form._%28%28lib._syntax%2Fparse..rkt%29._~7e!%29%29 On Sat, Jul 25, 2015 at 9:55 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Hi

[racket-users] Affecting the errors generated by syntax-parse

2015-07-25 Thread Jens Axel Søgaard
Hi All, The syntax-parse form can often generate sensible errors based on the progress made during the attempt to match a pattern against a syntax-object. Given multiple choices the choice where the maximum progress was made is used to generate the error message. Is there a way to tell

Re: [racket-users] Affecting the errors generated by syntax-parse

2015-07-25 Thread Jens Axel Søgaard
Hi Stephen, Thanks for testing this. Turns out I had removed a #:opaque in Definition while cleaning up the example before sending the mail. Now I get the same error as you. With (define-syntax-class Definition #:opaque #:literals (define) (pattern (define (name:Id a:Id ...) body:Body)))

Re: [racket-users] Affecting the errors generated by syntax-parse

2015-07-25 Thread Stephen Chang
Actually, I dont get the begin expected error that you mention. I'm getting: define: expected identifier parsing context: while parsing Id while parsing Definition while parsing TopLevelForm in: 4 with the 4 highlighted, which seems correct since it comes from using the Definition