Re: [racket-users] help with splicing syntax class error report

2017-03-15 Thread Dan Liebgold
On Tuesday, March 14, 2017 at 11:05:08 AM UTC-7, Stephen Chang wrote: > > 1) Use a commit pattern, which tells syntax-parse not to backtrack > past the commit point. You have to change the order of patterns for > this to work. > [...] > 2) Use the ~post pattern, which essentially tells syntax-par

Re: [racket-users] help with splicing syntax class error report

2017-03-14 Thread Stephen Chang
You get the dreaded "bad syntax" because syntax-parse doesnt know which pattern failed. There a couple of things you can do: 1) Use a commit pattern, which tells syntax-parse not to backtrack past the commit point. You have to change the order of patterns for this to work. (define-splicing-synt

[racket-users] help with splicing syntax class error report

2017-03-14 Thread Dan Liebgold
Hi - I have some legacy code syntax I'm retrofitting with syntax-parse. Is there a simple way to have this type of syntax error report a better error message: http://pasterack.org/pastes/59739 I'd like it to point directly to ":thung" and say it expected ":thing" or nothing there if possible.